//varying blink duration with a potentiometer
void setup() {
pinMode(2, OUTPUT);
pinMode(A0, INPUT); //dont actually need to set this pin
// because when we use the analogRead fnc it automatically sets it
Serial.begin(9600);
}
//blink program
void loop() {
int pot = analogRead(A0);
Serial.println(pot); // display pot reading in serial monitor
// use pot value as delay instead of 1000ms
digitalWrite(2, HIGH);
delay(pot); //1s delay
digitalWrite(2, LOW);
delay(pot);
}