Answers for "arduino as a potentiometer"

C++
1

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