Answers for "read potentiometer arduino"

C++
2

read potentiometer arduino

void loop() {
  val = analogRead(potPin);    // read the value from the sensor
  digitalWrite(ledPin, HIGH);  // turn the ledPin on
  delay(val);                  // stop the program for some time
  digitalWrite(ledPin, LOW);   // turn the ledPin off
  delay(val);                  // stop the program for some time
}
Posted by: Guest on December-31-2020

Browse Popular Code Answers by Language