Let me start introducing myself. My name is Erwin (a.k.a. ambuman) and I'm from Holland.
Recently I celebrated my birthday and guess what...
They've bought daddy an Arduino (with a breadboard and wire kit)!!!
Well..
You know how that goes.
Daddy searches the WWW...
Daddy orders his goodies...
After a propper inspection daddy passes the "secret box" that he got from the mail man to mommy...
Mommy wraps it up...
You figure out the rest, including the oohs and aahs...
;D
After playing around a bit with simple LED blinking speed and some Knight Rider fun I made up MyFirstArduinoProject Huh
@ CodingBadly
Nope... I used the centre light in the Knight Rider program to test the stuff. In this program I left it out on purpose. It splits the two sides nicely.
I thought of interfacing to the electronincs in the car from work.
Probably that will make my boss go nuts... :o >:(
The lightbar on my car sucks bigtime...
;D
Oh well.. That wasn't so special.
Just an amazingly simple switch on and switching off with a few LED's.
Here it is.
Erwin.
// Emergency
int LED1 = 1; // the number of LED pin 1
int LED2 = 2; // the number of LED pin 2
int LED3 = 3; // the number of LED pin 3
int LED4 = 4; // the number of LED pin 4
int LED5 = 5; // the number of LED pin 5
int LED6 = 6; // the number of LED pin 6
int LED7 = 7; // the number of LED pin 7
//Timers and counters
int timing = 30;
byte count1 = 1;
byte count2 = 1;
byte count3 = 1;
byte count4 = 1;
void setup ()
{
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
}
void loop ()
{
// Code for blinking order
do
{
digitalWrite(LED3, HIGH); // set the LED on
delay(timing); // wait for 'timing' millisec
digitalWrite(LED2, HIGH); // set the LED on
delay(timing); // wait for 'timing' millisec
digitalWrite(LED1, HIGH); // set the LED on
delay(timing); // wait for 'timing' millisec
digitalWrite(LED3, LOW); // set the LED off
delay(timing); // wait for 'timing' millisec
digitalWrite(LED5, HIGH); // set the LED on
delay(timing); // wait for 'timing' millisec
digitalWrite(LED2, LOW); // set the LED off
delay(timing); // wait for 'timing' millisec
digitalWrite(LED6, HIGH); // set the LED on
delay(timing); // wait for 'timing' millisec
digitalWrite(LED1, LOW); // set the LED off
delay(timing); // wait for 'timing' millisec
digitalWrite(LED7, HIGH); // set the LED on
delay(timing); // wait for 'timing' millisec
digitalWrite(LED5, LOW); // set the LED off
delay(timing); // wait for 'timing' millisec
digitalWrite(LED5, LOW); // set the LED off
delay(timing); // wait for 'timing' millisec
digitalWrite(LED6, LOW); // set the LED off
delay(timing); // wait for 'timing' millisec
digitalWrite(LED7, LOW); // set the LED off
delay(timing); // wait for 'timing' millisec
count1++;
}
while(count1<=3);
do
{
do
{
digitalWrite(LED1, HIGH); // set the LED on
digitalWrite(LED2, HIGH); // set the LED on
digitalWrite(LED3, HIGH); // set the LED on
delay(timing*3); // wait for 'timing'*3 millisec
digitalWrite(LED1, LOW); // set the LED off
digitalWrite(LED2, LOW); // set the LED off
digitalWrite(LED3, LOW); // set the LED off
delay(timing*3); // wait for 'timing'*3 millisec
count2++;
}
while(count2<=3);
do
{
digitalWrite(LED5, HIGH); // set the LED on
digitalWrite(LED6, HIGH); // set the LED on
digitalWrite(LED7, HIGH); // set the LED on
delay(timing*3); // wait for 'timing'*3 millisec
digitalWrite(LED5, LOW); // set the LED off
digitalWrite(LED6, LOW); // set the LED off
digitalWrite(LED7, LOW); // set the LED off
delay(timing*3); // wait for 'timing'*3 millisec
count3++;
}
while(count3<=3);
count4++;
}
while(count4<=3);
count1=1;
count2=1;
count3=1;
count4=1;
}
I did a similar project. Everyone loves police lights! Using super-bright blue and red LEDs really helps get the right effect. See Arduino Police Lights | Project Lab