Arduino

Arduino

Postby laurent » Fri Dec 23, 2011 3:32 am

hello Mickael

I would like to know if it is very there that I have to modify the 10 seconds by default of the countdown.

The part in red


And I would like to know the tension of functioning of the buzzer? it's 2v ?

The time is good in milliseconds?? 1 secondes = 1000 ??

thank you..
**********************************************************************************

// Reset back to the last second boundary so we can start the countdown
// immediately and so that the first second isn't truncated
TCNT1 = TIMER1_SECOND_START;

beep(3800, 30);
digitalWrite(LED_DET, ledCurrentState);
while ((countdownSeconds > 0) && (!defused)) {
for(int i=0;i<10000;i++) { //10000 represent 10 seconds?
// get input
if (digitalRead(defusePin) == HIGH) {
defused = true;
break;
}
if (digitalRead(detPin) == HIGH) {
countdownSeconds = 0;
break;
}
}
delay(20);
if (ledCounter++ > ledCounterThreshold) {
ledCounter = 0;
if (ledCurrentState == HIGH) {
ledCurrentState = LOW;
} else {
ledCurrentState = HIGH;
}
digitalWrite(LED_DET, ledCurrentState);
}
}
digitalWrite(LED_DET, LOW);
countdownRunning = false;
if (!defused) {
detonate();
} else {
beep(4500, 80);
delay(2000);
displayCountdown = false;
}
laurent
Newbie
Newbie
 
Posts: 17
Joined: Wed Dec 14, 2011 5:24 pm

Re: Arduino

Postby Michael » Fri Dec 23, 2011 8:36 am

Laurent,

The default countdown of 10 seconds is defined here:

#define COUNTDOWN_DURATION 10

You can change that.

The buzzer is driven by a 5V PWM square wave.
Michael
Administrator
Administrator
 
Posts: 464
Joined: Sat May 29, 2010 8:24 am

Re: Arduino

Postby laurent » Fri Dec 23, 2011 8:48 am

thank you ...mickael...


I finished my 1st version of my "bomb"

I would make another "bomb" soon, even more beautiful..

Merry christmas and good year Mickael
Attachments
bombe-v23.jpg
bombe-v23.jpg (770.03 KiB) Viewed 1187 times
bombe-v22.jpg
bombe-v22.jpg (847.66 KiB) Viewed 1187 times
bombe-v21.jpg
bombe-v21.jpg (934.5 KiB) Viewed 1187 times
laurent
Newbie
Newbie
 
Posts: 17
Joined: Wed Dec 14, 2011 5:24 pm

Re: Arduino

Postby Michael » Fri Dec 23, 2011 8:54 am

Merry Christmas and Happy New Year, Laurent. Your project looks wonderful! Great job.
Michael
Administrator
Administrator
 
Posts: 464
Joined: Sat May 29, 2010 8:24 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests