Skip to content

Latest commit

 

History

History
executable file
·
21 lines (17 loc) · 392 Bytes

02_potentiometer.md

File metadata and controls

executable file
·
21 lines (17 loc) · 392 Bytes

02. Potentiometer

/*  02. Blinking LED fast/slow according to potentiometer
        https://www.arduino.cc/reference
*/
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  int val = analogRead(A0);             // potentiometer value

  digitalWrite(LED_BUILTIN, HIGH);
  delay(val);
  digitalWrite(LED_BUILTIN, LOW);
  delay(val);
}