MichDragstar
Published © GPL3+

Arduino UNO + Flashing LEDs + POT

LED1 double flash than LED2 double flash, speed between LED1 and LED2 adjustable by POT.

BeginnerFull instructions provided1 hour1,972
Arduino UNO + Flashing LEDs + POT

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
5 mm LED: Red
5 mm LED: Red
×2
Resistor 100 ohm
Resistor 100 ohm
×2
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Story

Read more

Schematics

2x_led_double_flash__pot_arduino_uno_1IChVdTY4P.fzz

2_leds_double_flash_pot_arduino_uno_d0rys5XNqt.jpg

Code

Arduino UNO Code

C/C++
//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);
}

Credits

MichDragstar
7 projects • 17 followers
Contact

Comments

Please log in or sign up to comment.