Go Down

Topic: Arduino Kitchen Timer (Read 1 time) previous topic - next topic

anonymouse197

Jun 01, 2011, 10:44 pm Last Edit: Jun 02, 2011, 06:14 pm by anonymouse197 Reason: 1
Hello,

I have been trying to make an Arduino Kitchen Timer for quite some time now. After lots of troubleshooting I have managed to get it almost working! So far the design is that a normal LED Bar Graph counts up when a button is held, then each LED turns off every five minutes. The code so far is as follows:

http://www.mediafire.com/?4hwd25wf0n8qq91

The Fritzing sketch is as follows, but please note that LEDs are not used!



The issue that I am struggling with at the moment is not one of Hardware, I know that it all works and is in theory wired correctly. At the moment I am noticing that when the 6th LED bar lights up there is more of a delay, and that the timer is not counting past 5 mins. I have also not wired in the Piezo speaker as I don't have on.

I hope you can help me :)
Ari

Coding Badly


The link in your post produces rather nasty pop-up advertisements.  Please remove the link or I will ask the moderators to consider your message spam and remove it.

PaulS

If you have nothing to do in the else block, just omit it. Empty else blocks look silly.

Some useful reading here:
http://arduino.cc/en/Reference/Array

Why is there a 3 second delay in setup()? Are you waiting for the genie to appear and clean the kitchen?

More useful reading:
http://arduino.cc/en/Reference/For
Computers are good at repetition. Let the cooper replicate the code (by using a loop) instead of you doing it using copy/paste.

Also:
http://arduino.cc/en/Reference/Increment

Code: [Select]
   analogWrite(speakerOut,128);
The analogWrite() function only works on PWM pins. Pin 1 is NOT a PWM pin.

Quote
At the moment I am noticing that when the 6th LED bar lights up there is more of a delay, and that the timer is not counting past 5 mins. I have also not wired in the Piezo speaker as I don't have on.

Have you tried using Serial.print() to see what is happening? Of course, you'll need to change the value in speakerOut, since pin 1 is part of the hardware serial port.

anonymouse197

My Apologies 'Coding Badly', as you will see the code I would like to post exceeds the maximum message length for the forum so I have had to post it elsewhere, I will look for an alternative place to post it.

The 3 second delay is giving people time to reset the device then press and hold the button, it is just for ease of use - but thank you for the help, I will have a look at the background reading that you have offered.

Thanks!  :)

justjed


Are you waiting for the genie to appear and clean the kitchen?


And when she's finished, can you send her over?
... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier

Go Up