Step 5: Connecting The Buttons

Connect one push button between Arduino pin 2 and GND , the other between Arduino pin 3 and GND.

<p>Hello, I was wondering if this clock can be made using a 32 X 64 RGB LED Matrix Board such as can be purchased from AdaFruit? it would make the display portion easier and construction simpler.</p>
<p>Hi there. I have built this clock. It works great apart from not being able to set the time and change any of the controls. As the curser will not move using the two buttons. It will go through all of the menus. It just will not allow me to move the curser in order to choose a menu. Hence; Unable to move into settings?</p><p>Please could you advise me on what to do. I am using version 1.0.5 and a cheap uno board. And I am using a pre-built DS3231 RTC AT24C32 12C Precision Real Time Clock &amp; Memory Module. (Bought off ebay) Does this RTC need extra software. It does keep the time on the pong board? There is nothing wrong when I verify the software and it uploads without any problems.</p><p>I thank you for your time.</p><p>Stuart Smith.</p>
<p>Great Clock, just looking for someone to help with some design files for a case / mounting device :)</p>
<p>Saw your project and just HAD to do it.</p><p>Got all the parts and downloaded the most recent code (Nov. 2013) to run <br>with the Arduino 1.05 software.</p><p>Loaded the four libraries and when I went to compile I get the following <br>error:</p><p>error: 'myfont' was not declared in this scope.</p><p>The Font library is in libraries so am kind of lost.</p><p>Running the Arduino with a PC.</p><p>Any help would be appreciated.</p><p>Thanks, Paul</p>
<p>I just got the same errors trying to verify the code. I opened the font library file and declared myfont, tinyfont and bigfont constant, by adding const between unsigned and int. </p><p>Hope I could help.</p>
<p>Just wanted to chime in and say I was having the same problem and adding &quot;const&quot; for all three and it seems to work like a charm! Thanks!</p>
<p>I;m sorry, could you explain where you went? my font code already has 'const' in it</p>
<p>I'm on my work computer so I don't have the edited library in front of me, but try this. Just add &quot;const&quot; to three of the lines. Find and change this:</p><p>unsigned char PROGMEM myfont[80][5] = {</p><p>to</p><p>unsigned const char PROGMEM myfont[80][5] = {</p><p>this</p><p>unsigned char PROGMEM mybigfont[10][20] = {</p><p>to </p><p>unsigned const char PROGMEM mybigfont[10][20] = {</p><p>and this</p><p>unsigned int PROGMEM mytinyfont[42][3] = {</p><p>to</p><p>unsigned const int PROGMEM mytinyfont[42][3] = {</p><p>I'm pretty sure this is what I did to get it to compile. I'm still pretty new to the programming so I hope this helps.</p>
<p>Ya, this was all written on IDE 0023, and other IDE updates after tended to kinda puke on it...lol...</p>
<p>Thanks... I went to the author's site and posted problems there. The solution that finally worked was to start with an empty &quot;library&quot; (rename the old library... old library or something) create a new &quot;library&quot; folder and import the 3 libraries that come with the program so that they are the only ones in there. After that it worked like a champ.</p><p>Glad you found another solution. I will keep that in mind for similar problems in the future.</p>
<p>Hey, so i am going to build this (already have most of the parts.) but i have minimal experience with bread boards and doing this stuff. any Ideas where to go to learn? like videos?</p>
<p>Can someone help me to work with sure electronics 32x8 green led module to run as a simple clock.</p>
<p>This was my first project !</p><p>Thank you so much for a simple, fun to make and awesome project ! </p><p>The included photos are of the prototyping stage. I am still muddling over if I should make it permanent or make other projects using the existing parts. I also made a small update to the 5.1 code using the 5.1 FR code which saved the settings to the RTC.</p><p>I also changed the RTC to use a DS3231, which required no changes to the code.</p><p>Hats off to everyone who contributed. You have made me day/week !</p>
<p>Used the AdaFruit DS1307 RTC kit and a $5 black crate from HobbyLobby craft store. </p><p>The crate holes are used for the cord and setting the clock with the buttons.</p><p>I had to edit the Font.h file and change all the unsigned char to const unsigned char to get it to compile.</p><p>Arduino UNO R3 with VisualMicro for VS 2013.</p>
<p>Great instructable!</p><p>I build the clock but used a DS3231 instead of the DS1307 due to the better accuracy on it. The most important thing I learned out of this the hard way (read - fried to arduino boards) is that if you use a backup battery for the RTC you must add a decoupling cap for it otherwise it short the vcc to the gnd. </p><p>Other from that it was a pretty straight forward build - THANKS :)</p>
<p>Hi,</p><p>Thanks so much for the instructable! I've built one and it looked great. However after a month or so after I had left it unplugged and unused as I had traveled, I returned home to a non-functioning clock. The displays do not light up and I've tried using another arduino and ds1307 board I had on hand with no luck. This has been confusing me since before I left, the clock had worked as intended yet now fails to do so. I've checked all the wiring yet I still don't know what to do. Do you have any ideas as to what might be causing the problem?</p><p>Thanks,</p><p>Daniel</p>
Hey, glad you built one!<br><br>Could be a bunch of things. Check the power gets to the arduino and it lights up, check the LED on pin 13 blinks every second. If these work try just one display, if that works try another power adapter. Check your wiring to the displays too.<br><br>Good luck!<br><br><br>
Hi, <br> <br>First off thanks for the idea and the ible ;-) <br> <br>I built one and I have a little question if you don't mind; <br>The clock works perfectly but it freezes up. If you do the IT repair (power off, power on) it works perfectly again. <br>Any ideas? <br> <br>Oh, one more thing, for some reason the Uno is only pumping 3.4V DC from the 5V output, I found that I had to use the 5V supply to power the clock chip otherwise I got random code on the display and if your tried to change the clock time the number goes up and you can not select anything. <br>Put the 5V on and bob is your next door neighbour! <br> <br>Thanks <br> <br>Darren
Hi Darren,<br><br>Someone else had the same with the time freezing, he fixed it by replacing the DS1307, but it could be the power if your board is only outputting 3.4v. You might also have a bad connection to the clock chip. The LED on the arduino pin 13 should flash every second to let you know the clock chip is being read and ticking.<br><br>Make sure you are not powering the Uno from the round power jack and check the voltage from the 5v pin without anything plugged into the Uno. If it still reads low, maybe there is something up with your Arduino or power supply. If not maybe you have a short somewhere. Good luck!<br><br>Nick
<p>Best bet is to run the 5V to the displays, and then run a 5V line to the 5V of the Arduino - so basically the Arduino is powered from the displays. That was how I fixed the problem.</p>
This can happen if you are using a standard USB cable - they drop voltage like crazy. A beefier USB cable may solve this, OR you can use a power adapter. If you use a power adapter (don't go over 9V) and your regulator on the arduino is getting hot, see my instructable on <a href="http://www.instructables.com/id/Beef-up-your-Arduino-power/" rel="nofollow">beefing up your arduino</a>. If the clock gets less than 3.4V the clock stops sending data, and the program freezes. This was the entire reason (and project) I made that instructable for.
Thanks Nick, <br> <br>In your ible you do state to use the USB to power it and not the round power socket, I had been told that you only had to worry about this on older ones where you had to select the power source? not sure about that but I had also been told that on the new model UNO it did not matter which way you power it. <br>Turns out it does :-) <br>I cut down a USB lead and powered the unit from that and so far we have no issues. <br> <br>Should have done what you said in the first place! <br> <br>Thanks for coming back to me on this. <br> <br>Kind regards <br> <br>Darren
<p>How to set up the clock. I only have the menus like Pong or Word and when i press the Pong setup it stands there GO or BACK</p>
<p>one of the menus is to set the clock</p>
<p>Almost forgot ; guys be warned ...this game is addictive:)</p>
<p>Great projects; many thanks.</p><p>I think you can add audio to this game ; something like a 2-transistor multivibrator with a resistor connected to one of Arduino outputs; this will give simple beep for each action. or you can add full audio effects by tweaking the code. what di yo think ? </p>
Would it be possible for you to post a instructable using <a href="http://www.instructables.com/id/TV-Out-with-Arduino/" rel="nofollow">TVout</a>?
Sorry, let me clarify, could you post an instuctable using TVout to display the clock?
Awesome! <br>
Hey, I currently just finished building my pong clock but didnt feel that the coin cell holder and battery for the RTC chip was necessary when I bought everything. Now im trying to set the time for my clock and it isnt working!! I looked back at the instructions to see if I really needed the cell holder and it doesnt look like I do but I realized the RTC chip wasnt hooked up to the ground or positive terminal. So how do I hook the chip up properly?
Instead of an arduino can we use a pic micro controller.. Because i wanna make this clock for someone but i really dont want to give away my arduino
Very hard to say.. depends on the PIC, what outputs / inputs / what code it runs etc etc...
im new to the microcontroller world dont know much about em...<br>if not pic then any microcontroller with which i dont have to use my arduino board<br>cz u get the microcontrollers for like 3-4 dollars but the arduino i have was quite expensive..<br>is there a way to use the arduino boot loader without the arduino board?<br><br>P.s thanks for replying man im in love with your clock best iv ever seen.
Just get an Atmega328 chip. Program the bootloader and firmware into the chip, then remove and breadboard it or make a PC Board for it and put your original atmega328 back into your arduino. Simply swap the chips any time you need to update it. Personally I have a USB to TTL Serial adapter which cost about 2 bucks on ebay. I put a 3 pin TTL Serial in on my clock board (GND, RX, TX) hooked to ground, and pins 2 and 3 on the atmega328. When I want to update the code, I choose the com port the adapter is on (COM2: for example) and as soon as I see the &quot;Binary sketch size&quot; message in the Arduino information window, I hit RESET on the clock. Sounds like a lot of work, but it updates really fast. Faster than using a 6 or 10 pin ICSP connector - but that's also an option. The problem I ran into there is Arduino ISP 0023 doesn't see my ATTiny as a programming option. I would like to offer some general advice here too. POWER THE DISPLAY, NOT THE ARDUINO. If you have a reliable 5V source, power the display, and the arduino or Atmega328 will draw it's power from the display, and you don't have to modify any connections.
I think using any other microcontroller or pic would need a lot of work and re-coding to get the clock going.<br><br>If you look at in terms of how much time you would spend on trying to get it working, and how much you value your time, it's probably a cheaper option of you just bite the bullet and get another arduino. They are a bit cheaper on eBay if you search.
Yes u probably right man itll take a lot to rewrite the codes and redesign everything..<br>
The way to go is definitely as mischka says - use an ATMeag-328 and program it in your Arduino but then pull out the chip and put it into a socket on a piece of perf-board made up as indicated in the bread-board arduino tutorial. You need almost none of the gubbins on an Arduino board to make the chip run - that's mostly for development. Once you have it running you only need the chip, crystal and a few capacitors. You don't really even need a reset switch unless you are wanting to re-program it in place. With this project you are only using a few pins so it would be very easy to make up a '328 board. The '328 chips themselves only contribute about &pound;3-&pound;4 to the cost of the project.
You could buy the ATMEGA preprogrammed with the arduino bootloader, program it with your arduino board and wire it like this: http://www.instructables.com/id/Standalone-Arduino-ATMega-chip-on-breadboard/<br><br>
I have modified the code to: <br>1) Allow switching from 24 hour to 12 hour time <br>2) Returns to whatever mode it was running before you change the time <br>3) I preferred a solid line down the middle of the pong &quot;court&quot;. <br>4) sped up the ball a bit.
I have now added a brightness function too.
I am having a little problem, uploading the sketch, I can see nothing on my board :/
I would need more information to know what you mean. <br>1) by &quot;board&quot; do you mean the LED panels, or do you mean the arduino isn't receiving data? <br>2) What version of the IDE are you running? (You need to be running the older 0023) <br>3) are you uploading using the Arduino, or by an ICSP (ISP) programmer board?
See my instructable on &quot;Beefing Up Your Arduino Power&quot;. <br>http://www.instructables.com/contest/fixit2013/ (please VOTE if you can) <br>http://www.instructables.com/id/Beef-up-your-Arduino-power/ (direct link) <br>
Also see my Instructable on eliminating the wires from your clock module <br>(this is the project I use it with) <br> <br>http://www.instructables.com/id/Turn-your-Real-Time-Clock-module-into-a-mini-shiel/
If I wanted to rework the code a bit to where on the &quot;jumble&quot; section it changes to words instead of the time, how would I do that? I'm having a hard time seeing which code is drawing from the clock and which is creating the jumble. Thanks for your help.
In the Jumble function, remove the code from under the bit that says <br><br>//set final characters <br><br>all they way up until the bit that says:<br><br> byte x = 0;<br> byte y = 0;<br> <br> //until all counters are 0<br><br>Then replace it with lines that set the endchar array to the letters you wanted. E.g. if you did<br><br>endchar[1] = 'H';<br>endchar[2] = 'E';<br>endchar[3] = 'L';<br>endchar[4] = 'L';<br>endchar[5] = 'O';<br>endchar[6] = '!';<br>endchar[7] = '!';<br>endchar[8] = '!';<br><br>You should see the top line say &quot;HELLO!!!&quot; You can set the bottom line by setting endchar[9] to [15]<br><br>Hope this helps.<br>Nick<br>
Sorry that should be: <br> <br>endchar[0] = 'H'; <br>endchar[1] = 'E'; <br>endchar[2] = 'L'; <br>endchar[3] = 'L'; <br>endchar[4] = 'O'; <br>endchar[5] = '!'; <br>endchar[6] = '!'; <br>endchar[7] = '!';
Sorry again, here is the image of the chip.Please help!
Hey, I Can't see an image. Is it this breakout board? <br> <br>http://www.ladyada.net/learn/breakoutplus/ds1307rtc.html <br> <br> <br>Nick

About This Instructable


402 favorites


More by mrnick1234567: Pong Clock
Add instructable to: