gabbyshimoni icon

basic-use-of-potentiometer

gabbyshimoni | PRO | 11/12/18 10:51:59 AM UTC | 0 ⭐ | 681 👁️ | Never ⏰ | []
C++ |

380 B

|

None

|

0 👍

/

0 👎

#define potPin A0    // select the input pin for the potentiometer
int potValue = 0;  // variable to store the value coming from the sensor
 
void setup() {
  // declare the ledPin as an OUTPUT:
  Serial.begin(9600);
}
 
void loop() {
  // read the value from the sensor:
  potValue = analogRead(potPin);
  Serial.print("pot value=");
  Serial.println(potValue);
  delay(100);
}

Comments