Pages: [1]   Go Down
Author Topic: emergency vehicle lights  (Read 1813 times)
0 Members and 1 Guest are viewing this topic.
Lelystad, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello to all of you Arduino users,

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.
smiley-wink
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

Here it is:


Let me know what you think of it.
 :smiley

Regards,

Erwin.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 638
Posts: 50331
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice. I love flashing lights. as long as they are not on the cop car behind me.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13030
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool!

Is the center LED supposed to light during that sequence?
Logged

Lelystad, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your responses! smiley

@ 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.

Gr. Erwin.
Logged

New York
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Moo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice! I was just thinking today of how simple the light bar in my car would be to make on an arduino and you've clearly shown how!

Looks like you've started on a new and long lasting hobby  smiley-wink
Logged

Lelystad, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I thought of interfacing to the electronincs in the car from work.
Probably that will make my boss go nuts... :o  >smiley-sad
The lightbar on my car sucks bigtime...
 ;D
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And the code? smiley
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Lelystad, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh well.. That wasn't so special.
Just an amazingly simple switch on and switching off with a few LED's.
 smiley-wink
Here it is.

Erwin.

Code:
// 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;
}
« Last Edit: January 08, 2010, 01:27:35 pm by ambuman » Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Next step is to port the project to a 3 pin usage smiley
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Lelystad, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm.... :o
I think I have to sleep on that for a few nights... :-/
 ;D
Logged

Minneapolis, MN USA
Offline Offline
Full Member
***
Karma: 2
Posts: 162
Never catch a falling soldering iron...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did a similar project.  Everyone loves police lights!  Using super-bright blue and red LEDs really helps get the right effect.  See http://nootropicdesign.com/projectlab/2010/01/08/arduino-police-lights/

There's a video, and the code is posted.

Logged

Lelystad, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a nice one!
Bit more fancy coding than mine :o
I'm just a C/C++ newbie, but hey...
I'm learning in progress  smiley-grin
Thanks for posting!

E.
Logged

Pages: [1]   Go Up
Jump to: