AvP: Bomb gauntlet countdown

GlennTech

Active Member
Hey,
I know this is done before, but I would like to post this also.
I've made a bomb gauntlet countdown using and arduino duemilanove and 9 rectangler LEDS.
I'm still prototyping, my goal is a countdown from 9999 to 1. I got the numbers from a Word lettertype/font called Yautja. Blame the font not me for incorrect numbers. If you've to correct one than pm it to me :mad:.

This is the hardware
IMG_3320.jpg


The pin placement
Pinplace.jpg

This is incorrect ! I modified the code with other pins. You can keep this hardware but you'll have to adjust the code.

The video (countdown 9 to 1)
th_00019.jpg

If you connect the cathodes of the leds (negative pin) to the ground and the anodes (positive pin) to the corresponding pins then your hardware is finished

You need a code in order to countdown. I made this code very simply, not simplified, so everyone would understand it a bit.

Code:
//										   
byte nine_seg_digits[10][9]=  
//Arduino pin: 2,3,4,5,6,7,8,9,10
{{0,0,0,0,0,0,0,0,0},	//0
{1,0,1,1,1,0,1,1,1},	//1
{1,1,1,1,1,0,1,1,1},	//2
{1,0,0,0,0,0,1,1,1},	//3
{1,1,1,0,0,0,1,1,1},	//4
{0,0,1,1,1,1,1,1,1},	//5
{0,1,1,0,0,1,1,1,1},	//6
{0,0,1,1,1,1,1,1,0},	//7
{1,1,1,1,1,0,1,1,1},	//8
{1,1,1,1,1,1,1,1,1}	 //9
};

int timer = 1000;
int timerEnd = 1000;

void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}

void nineSegWrite(byte digit){
byte pin = 2;
for &#40;byte segCount = 0; segCount < 9; ++segCount&#41;{
digitalWrite&#40;pin, nine_seg_digits&#91;digit&#93;&#91;segCount&#93;&#41;;
++pin;
}
}

void loop&#40;&#41;{
for&#40;byte count = 10; count>0;--count&#41;{
delay&#40;timer&#41;;
nineSegWrite&#40;count-1&#41;;
}
for&#40;byte count = 10; count>0;--count&#41;{
delay&#40;timer&#41;;
nineSegWrite&#40;count-1&#41;;
}
delay&#40;timerEnd&#41;;
}

Upload it to the Arduino Duemilanove and you're done!!!

Simple as that.
 
It looks like you've got a good start there. One limitation is that the Arduino Duemilanove only has 14 digital outputs, so you'd need to get four of them to drive four digits. You could get the Arduino Mega 2560, which has 54 digital outputs. I decided to use a single Arduino running a MAX7219 driver, which can drive a matrix of 8 rows and 8 columns. I posted a thread about this in the Arsenal section several months ago, so you can look at that for ideas.
 
Looks great :mad:

I have to agree with Elkman on using that led driver chip

Your off to a good start keep it up man.
 
Going to use a driver, but haven't got a driver around and this is just a prototype version :mad:
And thanks for the positive comments
 
Modified the code;
Easier to upgrade;
Less memory required.

Next step:
Learn how to use a LED driver and extend the countdown (so it would even countdown from 9999 to 0).

If the numbers in the video aren't corresponding with the real ones; please contact me asap.
 
This thread is more than 13 years old.

Your message may be considered spam for the following reasons:

  1. This thread hasn't been active in some time. A new post in this thread might not contribute constructively to this discussion after so long.
If you wish to reply despite these issues, check the box below before replying.
Be aware that malicious compliance may result in more severe penalties.
Back
Top