Arnov Sharma
Published © GPL3+

Bi Flasher with and without Microcontroller

Learn how to Make a Bi Flasher Circuit with a Microcontroller and a Timer IC.

BeginnerFull instructions provided1 hour358
Bi Flasher with and without Microcontroller

Things used in this project

Story

Read more

Schematics

SCH for NANO

SCH for Attiny

Code

code

C/C++
int pinsCount=2;             // declaring the integer variable pinsCount
int pins[] = {2,3};          // declaring the array pins[]
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
}
void loop() {
for (int i=0; i<pinsCount; i=i+1){    // chasing right
digitalWrite(pins[i], HIGH);         // switching the LED at index i on
delay(70);                          // stopping the program for 100 milliseconds
digitalWrite(pins[i], LOW);          // switching the LED at index i off
}
for (int i=pinsCount-1; i>0; i=i-1){   // chasing left (except the outer leds)
digitalWrite(pins[i], HIGH);         // switching the LED at index i on
delay(70);                          // stopping the program for 100 milliseconds
digitalWrite(pins[i], LOW);          // switching the LED at index i off
}
}

Credits

Arnov Sharma
341 projects • 349 followers
I'm Arnov. I build, design, and experiment with tech—3D printing, PCB design, and retro consoles are my jam.
Contact

Comments

Please log in or sign up to comment.