//LED1 double flash than LED2 double flash, speed between LED1 and LED2 adjustable by POT.
//This code is for Arduino UNO, see also code for ATTiny85.
void setup() {
// put your setup code here, to run once:
// designate pin 12 and pin 13 as an OUTPUT pin for the LED
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
// designate pin A0 as an Analog INPUT for the potentiometer
pinMode (A0,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println (A0);
int potValue = analogRead (A0);
digitalWrite(12,HIGH);
delay(300);
digitalWrite(12,LOW);
delay(100);
digitalWrite(12,HIGH);
delay(100);
digitalWrite(12,LOW);
delay (potValue);
digitalWrite(13,HIGH);
delay(300);
digitalWrite(13,LOW);
delay(100);
digitalWrite(13,HIGH);
delay(100);
digitalWrite(13,LOW);
delay (potValue);
}
Comments
Please log in or sign up to comment.