int led = 13;
int pot = A0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(pot, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int potValue = analogRead(pot);
int mapPotValue = map(potValue, 0, 1023, 0, 4);
if(mapPotValue = 1) {
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
}