MichDragstar
Published © GPL3+

ATtiny85 + Flashing LEDs + POT

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

BeginnerFull instructions provided1 hour1,521
ATtiny85 + Flashing LEDs + POT

Things used in this project

Hardware components

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

Story

Read more

Schematics

2x_led_double_flash__pot_attiny85_HHQvxPFnfM.fzz

2_leds_double_flash_pot_atttiny85_4O42XuBE3E.jpg

Code

LES2C_WIM_FLASH2_ATTiniy85.ino

C/C++
//LED1 double flash than LED2 double flash, speed between LED1 and LED2 adjustable by POT.
//This code is for ATTiny85, see also code for Arduino UNO.


int val = 0;

void setup() {
  // put your setup code here, to run once:
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
}

void loop() {
  val = analogRead(3);

  digitalWrite(0, HIGH);
  delay(400);
  digitalWrite(0, LOW);
  delay(100);
  digitalWrite(0, HIGH);
  delay(100);
  digitalWrite(0, LOW);
  delay(val);
  digitalWrite(1, HIGH);
  delay(400);
  digitalWrite(1, LOW);
  delay(100);
  digitalWrite(1, HIGH);
  delay(100);
  digitalWrite(1, LOW);
  delay(val);
}

Credits

MichDragstar
7 projects • 17 followers
Contact

Comments

Please log in or sign up to comment.