Parts List:
- 2 x Model 2416 Red or Green LED matrix panels from Sure Electronics (Make sure you get the version based on the HT1632C and not the HT1632).
- 1 x Arduino Duemilanove / Uno with ATmega 328 CPU
- 1 x DS1307 real time clock chip (and socket if you are soldering)
- 1 x Crystal oscillator for the DS1307
- 1x 3.3v coin cell battery and battery holder for the DS1307
- 1x Arduino prototyping shield, or breadboard and jumper wire if you don’t want to solder.
- 1x 16 Pin IDC Socket for the display connection if you are soldering.
- 2 x push to make buttons
- 1x USB Lead
- 1x Mains to USB power adapter
Plus wire, solder, sweat, tears, etc.
Parts in Detail…
2 x Model 2416 LED Matrix Displays from Sure Electronics. You can get these from Sure’s eBay store for $15 each: http://www.sure-electronics.net/ You can buy either the red or green display, and with 3mm or 5mm LEDs. (My clock is made with the 3mm green one.) Make sure you get the newer version of the display which is based on the Holtek HT1632C chip. You can tell the newer displays as they have the controller chip and DIP switches on the back. The front is relatively empty of components – see picture below.
Sure 2416 LED Matrix with HT1632C.
1 x Arduino Uno / Duemilanove / Dicecimila with ATmega 328 CPU. The Arduino is the brains of the clock. It has a microprocessor that runs the clock software, plus inputs and outputs we connect to the displays, buttons and other components. Ensure you get an Arduino with the ATmega 328 CPU. The Uno is the latest version and has one as standard. Some Duemilanove / Dicecimila boards come with the ATmega 168 CPU with doesn’t have enough RAM for the clock code. You can get Arduino’s for about $30. Try Sparkfun Electronics or eBay.
Arduino ‘Diecimila’ with ATmega 328 CPU.
1 x Arduino Prototyping Shield and Header pins. The prototyping board or ‘shield’ plugs onto the top of the Arduino making it easy to add components. It brings all the Arduino’s input and output pins onto a circuit board that you can solder components to. Get a board which is designed for a chip to go on, i.e. one that brings each pin of the IC out to a solder pad you can connect wires to – see picture. Again places like Sparkfun or eBay are good sources for them. You should be able to pick one up for $15 – $20. Check you get the black header pins too as some boards are sold without them. If you don’t like the idea of soldering, you could get a breadboard and jumper wire to build the circuit on temporarily instead. This is a good idea anyway to test it’s all working.
1 x DS1307 Real Time Clock (RTC) chip, Crystal, 3.3v Coin Cell Battery & Holder. The clock chip keeps time, regulated by the crystal. The battery powers the chip if the clock is unplugged, so it remembers the time when you turn it back on. I found all these bits on eBay bundled as a kit for $10.
1x 16 Pin IDC Socket. The display panels come with ribbon cable that needs to connect to a socket like this. We’ll need to solder it to the prototyping shield so we can plug the display ribbon cable in. They are a couple of dollars on eBay. If you aren’t planning to solder, you don’t need this.
2 x ‘Push to Make’ Buttons. These are used to set the time / change the display mode. You can get them for a few dollars.
1 x USB Lead – Type “A to B”
This is needed to to program the Arduino, and then as a power lead for the clock.
1x Mains to USB Power Adapter
This is used to power the clock and you can pick them up for less than $10. Look for one with an output of 150mA or above.
Wiring it up…
This is how it’s all connected…. not too difficult.
Note:
- The 2 push buttons are not shown in the above diagram. You will need to connect one button between Arduino digital pin 2 and GND. The other button needs to go between Arduino digital pin 3 and GND.
- Due to my crappy skills at diagrams, the pin layout on the DS1307 is not exact. Pin 8 should really be top right opposite pin 1. All the pin numbers are correct in terms of what they connect to however, so follow the numbering and you should be fine.
Connecting The Parts In Detail…
LED Displays
The displays use a serial protocol called SPI to receive data. There are only 4 wires needed between the Arduino and the first LED display. Two more wires are required for power.
You’ll notice each display has 2 connectors on the back. These are for daisy chaining multiple units together as we are doing, and it’s what the little ribbon cable in the box is for. Connect the displays together using the ribbon cable. You can use either connector on the back, they are the same.
Use one of the free connectors on either display to connect to the Arduino. Again it doesn’t matter which one. For testing purposes I poked jumper wires from the Arduino into the ribbon cable connector. When I was happy things were working, I soldered the IDC socket to the prototype shield, meaning I could plug the ribbon cable in.
As on the wiring diagram, Pins 4 and 5 on the Arduino need to connect to pins 1 and 2 on the display connector respectively. These are used for something called Cable Select or ‘CS’. Cable Select determines which display listens when the Arduino is sending data out. The displays have small DIP switches to set their cable select address – essentially giving them different identities. Set one display’s switch to have CS1 on , and the other to have CS2 on .
Pin 10 on the Arduino is used to send the actual display data, and connects to pin 7 on the display. Pin 11 on the Arduino sends a clock signal. Connect this to pin 5 on the display.
Finally connect pin 12 on the display connector to positive and pin 11 to GND. Alternatively if you prefer you can use the screw terminals on the back of the display for power.
A display with dip switch set as number 1.
Clock Chip
The DS1307 clock chip keeps the time. It uses something called the I2C protocol and only needs 2 wires to send time data to the Arduino. Connect pins 5 and 6 from the DS1307 to Arduino pins A4 and A5.
Connect the crystal between pins 1 and 2 on the DS1307. The crystal regulates the clock and can be connected either way round.
Finally the coin cell battery’s positive terminal connects to pin 3 on the DS1307 and the negative terminal connects to GND . The battery runs the clock chip if the power is turned off meaning you don’t have to reset the time. It should last for many years.
Push Buttons
Connect one push button between Arduino digital input pin 2 and GND, the other between Arduino digital input pin 3 and GND.
Power
We’ll supply power in using the USB port on the Arduino and then connect everything to the Arduino’s 5v and GND pins. Connect the 5v pin from the Arduino to the 5v pins on the display and DS1307. Then connect the GND pin from the Arduino to GND pins on the display and DS1307.
A FEW WORDS OF CAUTION WITH THE POWER…
Don’t use a higher voltage supply into the Arduino’s round power jack. The Arduino’s onboard regulator may not be able to cope with the power demand. If you try you’ll notice the Arduino will get very hot very quickly and probably not last too long!
Be very careful if you are powering the Arduino from a computer’s USB port. You could easily damage the port if you have a connection wrong or if the computer can’t supply enough juice. I powered my setup with my Macbook for testing and all was well, but be warned!
Prototyping shield
The prototyping shield plugs into the Arduino making it easy to add components. On a standard prototyping board you should have room to solder the DS1307 clock, crystal, battery and the IDC socket for the display ribbon cable. I attached the 2 buttons with wire, but you could solder them direct to the board.
I can’t really give instructions for what to solder where, as prototyping boards vary quite a bit depending on what you buy, but you should be able to figure it out based on the circuit diagram.
When things are soldered it should look something like mine in the picture. You can see the IDC plug on the right for the display cable, in the middle is the DS1307 clock chip. The tiny silver capsule above the chip is the crystal. On the left is the coin cell. The red button top right on the board is a reset button which came in the pack with the shield. It’s useful as the shield covers up the reset button on the Arduino itself.
Below you see everything connected together. The 2 displays plug into the prototyping board which sits on top of the Arduino. Nearly done!
Uploading the Clock Code
The last job is to upload the clock code to the Arduino. First you’ll need to download the Arduino programming software, called the Arduino ‘IDE’.
Important! The pongclock code is not yet compatible with the latest version of the Arduino IDE called 1.0. To get the pongclock software to work, you need to download version 0023 of the Arduino IDE software.
Download the IDE from the Arduino Site here: Look under “Previous IDE versions” for 0023: http://www.arduino.cc/en/Main/software
Once that’s installed, download the zip fie containing the clock code from my page on Google Code: http://code.google.com/p/pong-clock/
Unzip the clock code file. Inside you will see the main clock sketch called pongclock.pde and 4 library folders called ‘Button’, ‘DS1307′, ‘Font’ and ‘ht1632c’. These libraries are extra bits of code needed by the main clock sketch.
Next install the libraries. When you installed the Arduino software it should have created a folder somewhere for your sketches (i.e. projects) to go in. Find that folder and create a new folder inside it called ‘libraries’ if it doesn’t already exist. Then copy the 4 library folders from the zip into this ‘libraries’ folder. After you have done that make sure you quit and restart the Arduino IDE to make it pick up the new libraries.
After restarting, go to the Sketch -> Import Library menu. If the libraries are in the right place you should see their names listed in this menu.
Now go to the File menu and open the main pongclock sketch. It ends in .pde. You should see the code appear in the main window. Next pick your Arduino Board Type in the Tools -> Board menu, then hit the Verify (Play) icon. The compile test should compete without errors.
Time to upload the code to your Arduino! Unplug the Arduino from the clock prototyping shield and plug it into your computer with the USB cable. Click upload and wait for the code to be uploaded. Watch the TX and RX LED’s on the Arduino flash for signs of data transfer.
Finally unplug the Arduino from the computer and plug it back into the prototyping shield. Then plug the USB lead from the Arduino into the USB to mains adapter.
All being well the display’s should spring to life. Use the buttons to set the time and then sit back and admire your handiwork!

Starting Pong Clock
Known Bugs
- Sometimes in pong a paddle will miss the ball when it’s not on the minute. I think it may be because the AI always assumes it can move the paddle to the programmed destination in time, whereas if that decision is computed when the ball is too near, it may not make it. Despite this, it does not affect the time if the paddle misses the ball.
- Sometimes after changing display mode the clock doesn’t get updated until the next minute comes up, so until that time it could show the time being a minute out. This just affects the display, the real time in the DS1307 is unaffected and the error is corrected on the next minute.
- The set clock routine could be better. At the moment the days aren’t read back from the DS1307 when you go into the routine.
Thanks
Thanks to WestFW on the Arduino forum for providing the initial driver code, mattt for the DS1307 bits and Alexander for the button library.












Hello, I came across your code for the Sure 2416 LED matrix. Could you send the font.h file?
Amazing work man! Thanks for sharing everything! I guess I will build my own!
Thanks, if you make one let me know!
Pingback: LED Pong clock - machine quotidienne
Hey, seemed to have taken away the .zip file and just uploaded the .pde. So i can’t find the font file
Hey, sorry about that – now replaced with the .zip.
Nice job. As for the enclosure, you can use a simple pair of plexiglass plates, as I do in Wise Clock 2 (video here: http://www.youtube.com/watch?v=QDD-25Y0qBg)
Hey Florin, your clocks look great.Did you cut your plastic enclosures yourself? I was thinking of trying some semi opaque plexiglass so you just see the diffused LEDs.
Nice work! I love the clock. Time to upgrade to DS3231! Set it and forget it.
J
Hey that’s cool. Saves the external crystal.
very cool, I may have to build one! Thanks for the detailed build notes.
Looked at it for approx. 30 secs, and decided I _MUST_ build one myself.
Just Ebay’ed the sure-elec led panels.
Happy days!
Hi
Just a quick question but why the 1632c chip spec and not the 1632? What is the difference please?
Mark
Hi,
The Sure display based on the 1632 suffers from getting very dim when a lot of the LED’s are on, whereas their board based on the 1632C doesn’t have this problem. As far as I know it’s because the 1632 needs additional driver circuitry which Sure didn’t implement. The newer 1632C has it built in.
Nick
Thanks Nick
Do you believe then that your code will work with the 1632 displays but the displays will perhaps exhibit just dimming issues?
Mark
Yes it will work, but you’ll need a different library for the 1632, and have to make a coupe of tweaks to the main code – I can email them to you if you are interested. (I had it working on the older 1632 boards before I upgraded them to the 1632C.)
Nick
Yes please send me the code to play with as I have accidentally ordered the 1632 based units and would like something to play with before I can afford the 1632C versions. I am templed by a couple of 32×16 dual colour units though with the 1632C controller.
I assume that you have my email address.
Mark
Hi !
Very nice job !
How do you control Pong ? From the PC ?
No, it’s all done on the Arduino, no PC needed.
Hi,
I’ve got mine up and running!
Atmega328 on breadboard and rtc on a small pcb that I made years ago
Looks awesome!
Hey great news! Glad it worked for you.
Thanks for this project, took a couple of hours to assemble this afternoon – I used a RTC module on a board from bluesmokelabs.com It also took a little while to work out where to connect the switches, your description in the post doesn’t match the photos, but I guess that’s one of deliberate mistakes to keep us on our toes.
It looks very nice alongside my nixie clocks, and I’ll have to build a case for it next week. Then on to try to program some more modes and maybe an alarm sounder…
Thanks again
Hey great to hear you made one. What confused you about the switches (apart from them missing from the schematic)? Maybe I can make it clearer in the instructions.
Love to see the case you come up with too.
Hi, I guess the confusion is in the connection of the switches.
You say connect them between A2/A3 and +5V. This should have been between A2/A3 and GND instead.
Clock is working great here. Etched a custom PCB for this. (so no arduino board needed)
Like Richard, I also have to workout a case for it. (acrylic probably)
Whoops, sorry if that lead you astray – should have checked before I wrote it all up. I’ve changed that now. Thanks for pointing it out.
Pingback: Wolf’s Spoor | Arduino Pong Clock
Hi
I was wondering if you heard of anyone getting this running using the 5mm version of the 2416 boards. I have been trying, following your instructions to the letter, and I get no where. I do have the 1632c.
Cheers
Hi Todd, I had a quick look at the data sheet and they look the same. (If you load up the data sheet from sure for the 3mm and 5mm models they are the same doc!).
So I’m not too sure why they aren’t working :(
BTW – You could ask on the Arduino forum if anyone has the same displays – there are a few threads about these displays.
Nick
It works perfectly with 5mm version
Thanks Denis
Good to know.
Thanks Nick
I figured I would ask you first just in case and the Arduino forums were doing their migration.
Thanks again for you time.
As proof of my earlier postings, see my version of the pong clock: http://ezwolle.blogspot.com/2011/01/pong-clock-this-clock-is-my-version-of.html
the button pins should be on the digital side not the analog side as per the program instructions
Good spot – now updated. Thanks.
I adapted your pong code to Wise Clock 3:
Pingback: Pong clocks using LED matrix modules - Hack a Day
Pingback: hackaholicballa - Pong clocks using LED matrix modules
Nick, Many thanks for the clock design. After waiting for a couple of weeks for the LEDs to arrive from Hong Kong I now have a red version up and running. http://youtu.be/t0pA_k7Px80
I did spot one thing on the circuit layout diagram which seems to differ from your photographs. The connections to the DS1307 seem to be the wrong way around. Using your numbering I have:
pin 5 to +5V
pin 6 unconnected
pin 7 to Arduino A5
pin 8 to Arduino A4
Many thanks again.
Hey Andy,
Really glad you liked the project and have built one. The red LED’s look great! I wish I had bought the dual colour displays now so I could have a menu option to switch colours.
As for the DS1307. The pinout I have is 5 and 6 to Arduino, 7 is N/C and 8 goes to +5v. Pin 8 is bottom right on my photo.
See the chip pinout here: http://www.datasheetdir.com/DS1307+Real-Time-Clocks-RTC.
Cheers
Nick
Hi Nick
Agree with the bi-colour LEDs they look great. I might just order one of those from sure and knock another clock together. :-)
I have the same data sheet and that’s how I connected the RTC chip. Perhaps I didn’t explain very well… The diagram that you have showing the connections between components has the pins on the right hand side of the RTC running from bottom to top, when they should go top to bottom (so +5v is opposite pin 1 for the crystal).
Hope that makes more sense.
Cheers
Andy
Ah I get you, diagrams were never my strong point! When I get time I might try and redo it.
Hi Nick,
I’ve made a few updates to the Arduino sketch, and was going to upload it to the google code project (but couldn’t work out how).
Have changed the normal_ clock to animate the digits, so when the time changes the changing digit scrolls down off the screen and the new digit scrolls in from above.
Have also added a couple of Binary clock modes.
If you’re interested then drop me a note and I’ll forward the updated sketch.
Cheers,
Andy
Hey, yes definitely – be great to see the new modes.
Nick
Here you go:
http://dl.dropbox.com/u/1026351/pongclock_v2_28.pde
Hey Just had a look at your code. I like the new modes -although I’m not sure I’ll ever be able to figure out the time from the binary display!
Hi !
I just saw you pong clock and I must say that it really looks great… I´m using also the 2416 displays but with the older 1632 chip on it. In earlier post I read that you have offered Mark Pepper to send him the code for the old display version. So I would like to ask you if you please can send me the code for the old 2416 displays…. Thank you very much !!!
Hi, just sent it to you.
Nick
Hi Nick !
Thanks you for your mail !! and sorry for the late reply…
Sven
Hi,
I was having problems understanding how you brought power to the display boards. When I connected the +5V and GND pins from the display boards to the (I’m assuming) the GND and 5V pins on the Arduino. But I do so, the power light on the Arduino goes off (I guess the Arduino board was drawing too much power). Any suggestions?
Hey, Yes I connect the +5v from the LED boards to the Arduino’s +5v pin, and GND from the boards to the Arduino’s GND pin. Sounds like you might have a short or maybe your power supply isn’t up to it.
Make sure you use a good mains to USB power adapter and connect it to the USB port, or connect a 5v supply to the +5v and GND pins. Don’t use the round power jack on the Arduino.
Nick
Nick,
After retrieving a mains to USB power supply (+5V) there was still no change. So connecting the +5V and GND pins from the display board to the POWER +5V and GND pins should work? Once the +5V pins are connected, the Arduino (Uno) board’s “ON” light cuts off.
DJ
Yes that should work unless you have a short. Both the LED boards and the arduino need 5 volts, so it’s just a case of connecting them together. Have you got a circuit tester – maybe test to see what happens to the voltage when you connect the LED’s.
Nick
Hi i saw this thing and its awesome, now i want to build one my self, Can i connect 4 display modules to make the hole thing bigger? can i use the same code for that?
I am new with programing, but i want to lern how to do.
Sorry for my English, i am from Sweden.
Best regards Axel
Hey, glad you like it. 4 displays would need quite a bit of changes to the code, but you could get the bigger 5mm LED versions of the displays, I have the 3mm ones which are smaller.
Hi, great idea. Very classic and great for gamers! Im curious about turning your idea into a table. That way my coffee table would display the time and play pong as well. Would there be any changes necessary to make it work as effectively as it already does? Thanks
I guess it depends on what you wanted to do. You would maybe have to design new display boards so they could drive individual LED’s to mount in the table. That could be quite a bit of work.
Nick
Hi there, been struggling for a while to get this running before i realised I’m using the ht1632 boards rather than the 1632c. Could you possibly email me the code for the older boards?
Dave.
Sent. Nick
Cheers for that, got the code compiling fine and got the heartbeat on pin13 but no output to the matrix. I’m using the red ht1632 boards, any configuration tricks for them? had a few other demo’s working and I know my RTC works.
Dave.
Hmm. Heartbeat means the clock is ticking and being read OK.
You should see something on the display if all is OK. I have the green boards so not tried the red. Try uploading some of the demo’s in this thread (see the post from WestFW): http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225239439 That’s where I got my code from.
Nick
Nick,
Okay I figured out that some of the connections on my display board wasn’t set up correctly. I have the boards showing up now. Question, is there a way to actually have 2 players be able to play?
That would take some coding and figuring out how to attach 2 controllers to the analogue inputs, it’s possible with some research. There are probably some tutorials on the Arduino site that might help.
Glad you got it up and running though
Nick,
Do you think there is a way to be able to run the game independent of the clock? I don’t have the necessary parts for the clock. I’m doing research right now also trying to figure out how to possibly use 4 push buttons (2 for each player to move up and to move down).
It’s possible, but you would need to change the code significantly.
Nick
Hi DJ,
I have the exact same problem! can you tell me how did you fix it?
Thanks a million!
How can I program four push buttons two for each paddle for a pong game. One being used to move the bat up and the other bat downward? Any ideas would really help!
You’d need to wire them up to 4 spare input pins, then re work the code so it moves the correct paddle up or down, plus you would need to change the scoring, and either strip out all the other clock stuff or add another ‘Game’ mode. I.e. it’s quite a bit of work!
Ok I understand, now in terms of your project I have been able to get it up and running which is fantastic by the way. The only issue I am having is setting the clock. It keeps saying oo:00?
Hi, wow!, what an amazing clock, superb code. I just built one myself. Built a simple but effective case using a perspex sandwich design similar to dotklok casing. Keep up the good work, I just love arduino.
Hi Nick,
You sent me a copy of the code for the older ht1632 controller. I made the changes to the Arduino PDE pong code as per your instructions and replaced the HT1632 file. After uploading to the Arduino and making sure the board was wired up correctly to the display, we had lift off. (Or not). Nothing displayed.
There seems to be a number of versions of the HT1632 file floating around for the 2416 display on the WWW.
Did you get this code working with the older 2416 Green displays. I know the displays are OK as I tried them with a Amicus18 board on another project. Any additional help would be appreciated.
Thanks
Kevin
Hi Kevin,
Yes I had the older versions of the board initially and that was the code I used. I’ve also sent the email you have to a number of other people who have had success using the older displays.
Hard to say what is wrong with your setup. Do you get the flashing LED on the arduino to show the clock is ticking?
Nick
Nick,
The Led on the Arduino comes on but is not flashing.
Tried another arduino unit and same result.
sorry I forgot to say, it comes on, flashes for a few seconds and then remains on.
Hmm. OK just to make sure – this is the LED that is connected to pin 13 on my Arduino. It should flash on when powered up, then stay off for the “Clock version x.xx” message, then start flashing every second when the clock goes in to pong mode.
With the display not connected it will stay off (just tried it). Really difficult to say without looking at it. You might want to see if the demo code from westFW here (see reply 8) works. You may need to adapt the pin numbers. That’s the basics of the library. If not maybe the displays are wired wrong.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225239439/all
Hi Nick,
Yes we are talking about the LED that is connected to pin 13. It it comes on, flashes for a few seconds and then remains on. The same result is seen even with the display not connected.
In terms of the demo file you refer toy, loaded this up and no problems. Worked are described. So either Windows 7 64bit is having a spooky effect on the compiler or my wiring is going wrong somewhere.
Spent ages on the Arduino.cc forum for these displays, a lot of people have a lot of fun with the older 2416 Green units. A couple of the demos produced a mirror effect, seen this before withe Amicus18 , found a fix for the Amiucus and finally the Arduino.
I shall do a bit more work on it later this week, just started working on Nixie Tubes. Even more fun and some interesting high voltages. Still all good fun.
Will let you know if I have any luck, thanks for your help.
Made my own!
I didn’t use your code tho. But thanks for the inspiration !
Hey looks great with the frame!
Hi Nick !
You helped me some weeks ago already and I am really happy with your clock. I used the more exactly working DS3231 real-time clock, and added a DS18B20 for showing the temperature…. So far so good. My question is hopefully without sounding to impudent :
I have 4 of the old yellow Sure 0832 displays and I would like to use them instead of the two 2416 displays. Is there a chance that you can adapt your code for the 0832 displays ? ? Of course you wouldn´t do this for free !!
Regards
Sven
Sven, if I may: you can also read the temperature from DS3231.
As for the 0832 displays, there is also a mechanical challenge in making a bigger matrix. Would be nice to see how you solve that.
Hi Florin ! Yes I know about the possibilty reading the clock from DS3231. But I am afraid that if it is built in a frame the temperature inside will give wrong values and I am not able to measure anywhere outside…. Why is it a mechanical challenge ? I would like to use 4 0832 instead of 2 2416 displays… so the height/dots is the same but it is more width/dots. Like this one here but with the pong clock :http://www.makehackvoid.com/member-projects/ht1632-avr-library-interface-ht1632-led-driver-ics-and-avr-micro-controllers
Regards
You are right about the temperature inaccuracy, especially if it’s inside of an enclosure, the values are skewed.
In the video you pointed to, there is a gap between the 2 0832 displays. That is because the displays have the PCB extended so they can be attached (with screws) to something. You would eventually need to cut those extensions, then somehow “glue” the 2 displays together. Not impossible, but challenging (and requires a bit of careful work).
Hi Florin !
I have already cut the extensions and attached the 4 displays together so that there is no gap :-) My problem is the rewriting of the code that splits the information to each of the 4 displays…. Therfore I need somebody :-)
Regards Sven
It’s nice to hear you managed to get rid of the gap. I would like to see your solution.
From what I imagine, the change in the code consists in talking to 4 different HT1632 chips (each controlling a 0832 display) rather than just one (controlling the 2416 display). You will have one CS line to each of the 0832 displays (whose address also needs to be set, with the switches).
A bit of work, but not “rocket science” as they say :)
Hi Florin !
It´s not that complicated… I had to rasp about 0.8 mm on one side of that v -cut point to get them a little closer. I used my small milling machine for that and it took about 5 minutes. Then I soldered a srew with its head down on that silver mounting holes and connected them with the peaces of v-cut material I broke away before (cut them into to the right lenght,drilling holes, and fixed them with a bolt). All together less than an our of work :-) Comming back to my question :-) and asking you directly : Are you able/willing to rewrite the code for me ?
Regards
Sven
Hey Sven,
Thinking about this there are 3 steps needed to get the code working…
1) Replace the current HT1632C driver library with the HT1632 driver – I have this already so not a problem,
2) As Florin says, we will need to re-write the driver parts of the code to cope with 4 displays. I.e. if the main part of the code is trying to plot a pixel at y=9, then it needs to know to plot it as pixel 1 on the second display. I can try and do this for you – but it may be hard to test without 4 displays to hand.
3)Tweak all the various clock routines so they are adapted to the new screen size as you are effectively adding 16 pixels width. – I don’t think I will be able to do this without having 4 displays, so I may have to leave it for you to play with.
Cheers
Nick
Hi Nick !
Of course I understand that it may be hard to do this without having the displays !!
I did step 1 already and currently using your code with slightly changes on the 2 2416 displays. It sounds great to me that you give it a try to do this !! …and of course I will and have to play with it !
Regards
Sven
Hi Sven,
What version of the display do you have? I need to get the datasheet from Sure, but from a quick look they seem to list the HT1632C versions only. Do you have that version or the older HT1362 version?
Nick
Hi Nick, it´s the OLD version HT1632
Sven
Hi Nick !
If you still look for the datasheet…. here is a link : http://www.sure-electronics.net/download/DE-DP105_Ver1.0_EN.pdf
Sven
Sven, I will give it a try. Are you in a hurry?
Hi Florin !
NO ! I´m not in a hurry…. :-) Good things take time !
Sven
Sven, looks like Florin is doing the hard work here, so I’ll hang back!
Sven, I uploaded this “draft” version for you:
http://code.google.com/p/wiseclock2/downloads/detail?name=Sure0832x4.pde&can=2&q=#makechanges
You will also need to download the font3.h file:
http://code.google.com/p/wiseclock2/downloads/detail?name=font3.h&can=2&q=#makechanges
I just compiled the code. I did not have the slightest chance to test it (I don’t even have an 0832 display around, plus it’s a Sunday :). You give it a try and let me/us know.
Even if it works, the digitalWrite() functions will need to be replaced with their “optimized” version.
Hi Florin !
Thanks a lot !! You are more than fast :-) I just downloaded it and will try it this evening.
Unfortunately I can´t try it now because I have to work ;-)
I will let you know the result….
Sven
Hi Florin !
I just have tested the “draft” code and here you can see what happens….
I checked the correct connection again but this is ok so far.
LINK : http://imageshack.us/clip/my-videos/192/ryx.mp4/
Sven
Not bad, for a first, blind, try.
It seems that displays 1 and 2 are accessed correctly.
In function displayScrollingLine, you need to make some changes. I left the second param as 0, but it should have been really “y”, and its value, set at the top of the same function, should be between 0 (top of the screen) and 10 (let’s say).
ht1632_putchar(-x+6, 0, ((crtPos+1 < strlen(msg)) ? msg[crtPos+1] : ' '));
should be
ht1632_putchar(-x+6, y, ((crtPos+1 < strlen(msg)) ? msg[crtPos+1] : ' '));
etc (same for the rest of the line).
I think you got the idea.
Hi Florin !
I changed the code to this here :
void displayScrollingLine()
{
// modify this value to display the text on the desired display row;
int y = 4;
// shift the whole screen 6 times, one column at a time;
for (int x=0; x < 6; x++)
{
ht1632_putchar(-x, 0, msg[crtPos]);
ht1632_putchar(-x+6, y, ((crtPos+1 < strlen(msg)) ? msg[crtPos+1] : ' '));
ht1632_putchar(-x+12, y, ((crtPos+2 < strlen(msg)) ? msg[crtPos+2] : ' '));
ht1632_putchar(-x+18, y, ((crtPos+3 < strlen(msg)) ? msg[crtPos+3] : ' '));
ht1632_putchar(-x+24, y, ((crtPos+4 < strlen(msg)) ? msg[crtPos+4] : ' '));
ht1632_putchar(-x+30, y, ((crtPos+5 < strlen(msg)) ? msg[crtPos+5] : ' '));
ht1632_putchar(-x+36, y, ((crtPos+6 = strlen(msg))
{
crtPos = 0;
}
}
Again a link what it looks like :
http://imageshack.us/clip/my-videos/696/uavt.mp4/
I will put the displays back together again… it´s not nice this here :-)
From wednesday till sunday I am not able to test because I do a little trip…
But I will be online if there is any question !!
THANKS !!!
Sven,
It look good to me. In principle, it works.
Now, do the following 2 steps:
1. insert these 2 lines somewhere in the file (close to the top):
#define fWriteA(_pin_, _state_) ( _pin_ < 8 ? (_state_ ? PORTD |= 1 << _pin_ : \
PORTD &= ~(1 << _pin_ )) : (_state_ ? PORTB |= 1 << (_pin_ -8) : PORTB &= ~(1 << (_pin_ -8) )))
2. replace "digitalWrite" everywhere with "fWriteA" (arguments to the function will stay the same).
This should speed things a bit.
Hello! Thanks for posting your project. It was extraordinarily helpful.
I got the clock working and even added a speaker and alarm mode to it-was a lot of fun.
I decided to string four of the displays together for a new project. I thought it would be as easy as changing the max x and max y. I was wrong. When I write to the third or fourth display the first and second go besonkers.(any two displays work perfectly on their own)
Any help would be hugely appreciated. I can post an image if you want to see exactly whats going wrong.
Thanks a lot!
Hey Joel, Glad you liked the project and got something out of it. Yes the code wont’ work as it stands as the driver bits are only written for 2 displays.
Each display needs it’s own Cable Select line, so first off you would need to wire up the other 2 CS lines from the displays (CS3 and 4) to the Arduino, say on pins 6 and 7. Set each diplay to 1, 2, 3 and 4, then change the code that defines the cs pins:
static const byte ht1632_cs[4] = {4,5,6,7};
also at the top you will want to set
#define NUM_DISPLAYS 4
and as you say change the max X and Y
Then, in the ht1632_plot and get_shadowram functions, you would need to tell the code which display (variable d) to write to depending on the pixels you want to plot.
E.g. if you had all the displays in a line, X would go up to 96. So plotting X=49 you would want that to be on display 2 (displays are numbered 0 – 3). So Just add 2 more if statments after the ones for x values 0-23 and 24-47. I.e. if the displays were in a line, add one for x=48-71 where d=2 and 72-96 where d=3. You also need to change the x=x-24 to x=x-48 and x=x-72
respectively.
…and youd need to do the same kind of thing in the function: get_snapshotram
There might be some other bits I've missed but hopefully that will get you started! Also see the post from Florin, as he is kindly helping someone do the same but with 4 x 0832 displays… the principle there is the same.
Nick
yes I had the CS lines and #displays. I had just missed the _plot and shadow ram functions. It works now. Thanks a lot for your speedy reply.
I had read the exchange between Florin and the 0832 displays. I actually have 4 of the same displays. But mine are the newer ht1632c so I figured the code wouldn’t be applicable.
Hey, great to hear it works. Love to see a pic / vid when you are done.
Hi Florin !
I´m back and I just tested the code with the changes you gave to me.
Here again you can see how it looks …… looks the same or is it just bit speed up ?
http://imageshack.us/clip/my-videos/822/veg.mp4/
Thank you !!
Sven
Sven, please also delete (or comment) the line
delay(3000);
in the loop.
….then it is so fast that you are not able to read it anymore :-)
Now you adjust that delay to suit your needs. Start with 10 (which is milliseconds), then increase until you like it.
O.K. I set it to 500…
So I attempted to string four of the 3208 in series. I modified all of the same code I did while stringing the four 2416′s together.
This time.
#define X_MAX 127
#define Y_MAX 7
and
if (x >= 0 && x =96 && x <=127) {
d = 3;
x = x-96;
}
In all the right places. It works great except for the fact that it wont print the rightmost 8×8 block on every display. I know this is because the 2416 is 24 wide and something is still set to that width per display. I looked at the code by florinC but because it was for the ht1632 I didn't know how to adapt it.
I know this line needs to be fixed. But I am too new to this to know how,
ht1632_sendcmd(d, HT1632_CMD_COMS01); // NMOS Output 24 row x 24 Com mode
Any advice for where to go would be great.
Thanks a lot!
Hey Joel, What chips do your displays have on them?
ht1632C.
Not sure if this helps, but I found this in function ht1632_setup() in my code:
#ifdef _16x24_
ht1632_sendcmd(HT1632_CMD_COMS11); // 16*32, PMOS drivers
#else
// (fc)
ht1632_sendcmd(HT1632_CMD_COMS10); // 32×8, PMOS drivers
#endif
Basically, you send the first command for the 16×24 display and the second for the 0832 display.
I am using the 3208 32×8 not the 0832.
I’m assuming other code in the shadow ram methods will have to be changed as well.
Are you sure it’s the HT1632C? The data sheet I found on ebay doesn’t mention it for the newer displays:
http://www.sure-electronics.net/download/DE-DP105_Ver1.0_EN.pdf
Look at page 12 – 3.3. Command Summary.
Under Common options you will want to set xx in:
ht1632_sendcmd(HT1632_CMD_COMSxx);
to the default listed on the page. This command sets up the HT1632 output pins for the display. For the HT1632 version of the 0832 it’s 10 (as in the data sheet above). See if you can find the data sheet for your particular version on Sure’s site.
Also in the code in all the HT1632 related functions where you see the value of 96, that is essentially
96 x 8 bits = 768 bits (double the number of pixels on the display). I.e. half of the bits are used for actual display data, the other half for the snapshot. You should change this to double the num pixels on the 0832.
See if that helps…
I will try that in the morning, thanks a lot!
Here is a link to the datasheet-
http://www.sure-electronics.net/download/DE-DP13211_Ver1.0_EN.pdf
Yes its it 1632C.
Yes I had to change it to 00. I probably could have guessed that :/
Now it plots the leftmost 8×8. However, it is only plotting all the even columns. Any idea how to fix this? I already changed the 96′s to 64′s.
Thanks again for your help.
Hey, Really hard to say to be honest without having a look at your code.
Sounds like you are going in the right direction though. Have you written a function where you can plot values and check where they appear on the display?
Nick
Hi Florin !
May I ask if we continue the project ?
Regards
Sven
Sven, what are your requirements?
I thought we/you rewrite the pong clock code for 4 0832 displays and the code you wrote is just to do the basic tests ?
Regards
Sven
Sven,
In Nick’s version of the code I have (which may not be the latest), I identified a few places with dependencies on the screen dimensions.
Here they are (updated with the values for your 64×16 display):
#define BAT1_X 1
#define BAT2_X 62
//very basic AI…
// For each bat, First just tell the bat to move to the height of the ball when we get to a random location.
//for bat1
// (fc) dependent on screen size;
if (ballpos_x == random(40,62)){// && ballvel_x 0) {
bat2_target_y = ballpos_y;
}
//when the ball is closer to the left bat, run the ball maths to find out where the ball will land
// (fc) also dependent on screen size;
if (ballpos_x == 15 && ballvel_x 0)
Nick may have already modified his code to make use of 2 macros that define MAX_X and MAX_Y.
Again, I did not test this code (don’t have the setup to do it). If you find a few things awkward, try to understand what the above numbers mean and play with them.
Hi Florin !
I´ve tried a little bit and it works with some little problems…. :-)
I have a problem with the clear display function. If I use the pong code that has this definition here
#define cls ht1632_clear
I get the error
void ht1632_clear(byte chipno)
too few arguments to function ‘void ht1632_clear(byte)
I deactivated the #define cls and all cls calls and the I was able to upload the first time – of course the display is not cleared then :-(
Do you have a idea what to do to get the clear display function working ?
I ´ve uploaded a video that shows the clock….
THANK YOU
Good job Sven.
Now, insert this function:
void ht1632_clear()
{
for (int i=1; i<=4; i++)
ht1632_clear(i);
}
and leave the #define cls ht1632_clear in place, together will all calls to cls.
Basically, we re-defined the old ht1632_clear (with no parameters) function.
(As before, I did not test this.)
Hi Florin !
I changed it and now I get another error message:
Pongclock_v2_28_0832_test.cpp: In function ‘void ht1632_setup()’:
Pongclock_v2_28_0832_test:41: error: too many arguments to function ‘void ht1632_clear()’
Pongclock_v2_28_0832_test:303: error: at this point in file
Pongclock_v2_28_0832_test.cpp: In function ‘void ht1632_clear()’:
Pongclock_v2_28_0832_test:564: error: too many arguments to function ‘void ht1632_clear()’
Pongclock_v2_28_0832_test:567: error: at this point in file
void setup is this here :
void ht1632_setup()
{
pinMode(HT1632_CS1, OUTPUT);
pinMode(HT1632_CS2, OUTPUT);
pinMode(HT1632_CS3, OUTPUT);
pinMode(HT1632_CS4, OUTPUT);
digitalWrite(HT1632_CS1, 1);
digitalWrite(HT1632_CS2, 1);
digitalWrite(HT1632_CS3, 1);
digitalWrite(HT1632_CS4, 1);
pinMode(HT1632_WRCLK, OUTPUT);
pinMode(HT1632_DATA, OUTPUT);
for (int j=1; j<5; j++)
{
ht1632_sendcmd(j, HT1632_CMD_SYSDIS); // Disable system
ht1632_sendcmd(j, HT1632_CMD_COMS10); // specific to 0832 display, PMOS drivers;
ht1632_sendcmd(j, HT1632_CMD_MSTMD); // Master Mode
ht1632_sendcmd(j, HT1632_CMD_SYSON); // System on
ht1632_sendcmd(j, HT1632_CMD_LEDON); // LEDs on
ht1632_clear(j);
}
}
void clear is just copy and paste from your post before
I don´t know if its important but the the arduino ide jumps (orange-highlighted) on the #define FADEDELAY 50 – doesn´t make sense to me…
Thsnk you !!
Hi there. Im looking for someone to help me create a custom LED project that would need to be very compact. I have a budget and would like to know if you may be interested.
thanks
does anyone have working code for the pong clock I downloaded the original file and got error codes
Probably means you have something wrong in your setup… e.g. you need to copy the libraries from the download into your setup.
Also make sure you aren’t using an old version of the Arduino IDE.
Nick
Hello, I’ve been busy with some other things and just got back to trying to get the 32*8 ht1632C displays working. I left off having everything working except that it is doubling the X value of all the positions. So turning on all the values will actually light only the even columns and the zeroth column. I’m not sure where to go :/ It’s probably something with the bitshifting. Anyway, im happy to send you the code if you want. As a thanks I’m happy to send you one of the displays as well.
Thanks :).
Hey Joel, Thanks for the kind offer of a display… I would love to but I just don’t have the time at the moment! If I get a chance I’ll let you know.
This is a really awesome project! I am a site manager on Instructables.com. You should consider submitting this as an entry to our Clocks Challenge. We’re giving away an iPad along with other great prizes.
You can check out the contest here: http://www.instructables.com/contest/clocks/
I would be happy to feature it on our site if you decide to post the instructions there and help get it noticed among our 10 million visitors. Let me know if you have any questions!
Cheers!
Carley
carley@instructables.com
Hey Carley, Wow, sounds cool! I like the Instructables site.
Sadly it looks like your competition is only open to the US and Canada. I’m in London, UK, so looks like I’m excluded.
hey nick,
me and my buddy are making a pop shots basketball game we have a string of 18 leds to keep score, i saw this pong clock so i built one and it works great but for some reason it wont change time i think i messed my ds1307 up but, I was wondering is there any way to add a counter to the program to keep score for our game im pretty sure there is a way my programming sucks though any suggestions
Yeah it could well be the DS1307… check all the connections, if they are dodgy it wont read the time.
I’m not too sure on your game but you could use some bits of my code and reprogram it to make a counter in some way. You would need to brush up on your coding though or get someone who knows a bit about it.
Good luck!
Hi Nick
Really great project indeed!!
I have the same idea as “jarell” about building a score counter
Basically I have a RF keyfob with 2 buttons (A and B) each of them giving points to Team A and Team B.
So far everything works on the Arduino serial monitor but I am not capable of displaying the results on the led matrix.
First :
int scoreTmp =0;
int score;
My code detects the state of the buttons and adds 1 for each time the button is pressed:
if (buttonState1 == HIGH) {
scoreTmp++;
}
Then:
switch (scoreTmp) {
case 1:
score1 = 100;
break;
case 2:
score1= 150;
break;
case 3:
score1 =200 ;
break;
default:
}
In the arduino Serial monitor I would use.
Serial.print(score1);
What should I do if I want to display it on the led matrix?
void demo_chars ()
{
ht1632_putchar(0, 0, ‘score1′, (GREEN));
ht1632_putchar(0, 8, ‘S’, (GREEN));
ht1632_putchar(6, 8, ‘c’, (GREEN));
ht1632_putchar(14, 8, ‘o’, (ORANGE));
ht1632_putchar(20, 8, ‘r’, (RED));
ht1632_putchar(26, 8, ‘e’, (GREEN));
}
Thanks for your help.
Hey Daniel,
Really sorry it’s taken so long to respond. You can use the putchar function in the clock code…
Set a message string like so:
char message[8] = {“SCORE 0″};
Then put it on the screen using…
ht1632_putchar(x, y, message[i]);
Where x and y are the pixel coordinates and i is the letter in the message. E.g.
ht1632_putchar(5, 5, message[0]);
would print an “S” 5 pixels to the right and 5 pixels down.
You can also use the above method with
ht1632_puttinychar for small characters
ht1632_putbigchar for the big numbers (there are no letters defined in the font, just 0-9)
Hope this helps…
Cheers
Nick
Hi, great project. I get ” ‘Button’ does not make a type ” when I compile in Arduino.
What does that mean?
I’m just about ready to build it. Any help would be greatly appreciated
Thanks
Oops sorry, I’m so dumb (and french!) When creating the libraries folder I spelt it wrong
sorry to bother, carry on :)
Hi, me again. Could not wait to build this, did it without the ds1307 chip!!
/Users/ericdugas/Desktop/pongclock.rtfd/Users/ericdugas/Desktop/pongclock.pdf
Excellent blog right here! Additionally your website a lot up fast! What web host are you the usage of? Can I get your associate hyperlink in your host? I desire my web site loaded up as quickly as yours lol
It is just a wordpress blog – sign up on the wordpress site.
Hey Nick,
just wanted to thank you for this awesome project, i love it !!
I’d just build one for myself and it looks splendid
just because of you, i bought my 1st arduino board and now i cant get my hands of it :p
thank you for that :)
just a little tini tiny thing… for some reason, the clock freezes sometime and the only fix is to reset the arduino board…. (arduino UNO with SM chip)
since my 1st attempt, ive switched to Richard Shipman s evolution of your sketch, and i havent run into the problem anymore… weird
anyway, a BIG THANK YOU for introdcuing me to arduino through this project, and i really hope you ll carry one improving this project and writing some more exciting projects
cheers ;)
Poto
Hey, really glad you built it and got into Arduino!
Since i really want to give you something back, i made a diagram of all the connection, like the one you have but it s in color (not too much tho…) and i ve included the little changes you talked about (pin number on the DS1307, added 2 buttons). Aswell, in case you are planning on going international, i can translate your instructable in french… tell me if you would fancy that
cheers again
http://i203.photobucket.com/albums/aa186/rosbiff/Divers%20a%20partager/ShemaPongClock.jpg
Hey that’s great… thanks so much. What did you make it in?
hey nick,
after few more tests, it appears that, even with Richards sketch(invaders), the clock freezes at a random time aswell…
i m lost, i checked connections and all but cant find why thoses freezes happen…
Have you heard of anybody having this problem or any ideas on how to fix it ?
thx in advance
Hey Poto. If you leave it in pong mode, does the time freeze or the ball too?
If it’s the time, I woud check the wiring to the clock chip – power data etc.
If it’s the whole thing check the wiring to the arduino and make sure you power supply is good, If it wavers it could cause things to lock up.
Nick
Hey Nick,
i just checked all that, powered the board through an UPS to really see if the problem was coming from the power… change location aswell, to double check…
but after some investigations, i suspect the ds1307 to be faulty…
i’ll order some new parts and i ll check again
i ll keep you posted
thx for the support ;)
Poto
the ball and the time freezes, but sometime i get the time back rght after reseting, some other times, i don’t…
must be the ds1307
I know I am no wizard but have you tried putting 4k7 resistor betweene 5v and pin 5 and 6?
Eric
Hey Eric,
no i havent try that….
since i know very little about electronic yet, can you explain me why should i do that and what effect will it have on the board ??
and what pin 5 and 6 are you reffering to ?? the ones on the arduino or the ones on the ds1307 ??
thanks for your help ;)
Hi Poto, the pins I’m referring to are of the clock chip DS1307. I’m not really sure about the resistor but they are in the datasheet diagram.
Some kind of pull-ups for the chip to behave normally?
If you try them, tell me if it helps.
Eric
well, i ve tried, and it doesnt work at all…
right now, it s 45:85 on my clock (when on pong mode), and i cant set it right…
if i change the mode to something else (ex:numbers) the time switches every second 12:62, 45:85; 32:54 …
Plus, if i am the only one with this problem, why those resistors are en issue with my clock and not the others ??
i’ll get back to you guys once i ve received the 10x DS1307 i ve ordered…. out of all of them, 1 must work, right ?? :p
thx for the help anyway
Have you tried this sketch?
http://www.ladyada.net/learn/breakoutplus/ds1307rtc.html
Eric
The sketch is pretty much at the bottom of the page.
Make sure to uncomment the line
//RTC.adjust(DateTime(__DATE__, __TIME__));
like so
RTC.adjust(DateTime(__DATE__, __TIME__));
I hope this helps
Well, as i was suspecting, the chip and/or the crystal is faulty. I went to the electrolab, an hackerspace in Paris, and they helped me fix it. new ds1307, new crystal, now it works like a charm ;)
thx for this awesome project, and someone mentioned that they wanted to play real pong on he clock; i love the idea so if i make it happen, you ll be the 1st to know ;)
thx Nick, thx Eric
Hey, glad you got it working in the end!
Nick
would it be possible to use an Arduino Mega instead as i have another project in mind that will require the mega
I don’t know as I’ve not got a Mega. I guess you would have to figure out which pins you could use on the mega (as it obviously has more), and change the code for it.
Hi nick,
i ve been making a homemade PCB for this project and so far everything works fluiently but a need an information that i cant find anywhere…
how to change the pin connection between the arduino and the DS1307+ ??
In your project pin 5 of the DS1307 is connected to A4 and pin 6 is connected to A5, i need to change that, where can i do it ??
i ve checked the sketch, the libraries and all but no luck … can you enlightened me ??
thx in advance ;)
Poto
just found out that it cant be changed ….
Hi, have you tried in setup:
pinMode(x pin, OUTPUT);
pinMode(x pin, OUTPUT);
then in loop:
digitalWrite(x pin, LOW);
digitalWrite(x pin, HIGH);
That is what I did in the RTC code as I needed to use Arduino pin 16 LOW (0v) and pin 17 HIGH (5V)
just a thought! again I might be really off the track here!!
Cheers
Eric
Hey Nick
I’m really keen on building a Pong Clock. I ordered also the parts already. Now I opened the code in the arduino program and added the libraries. Then I verified the code and there was a mistake and because I’m new into this I would like to ask you for some help.
every time I push verify, i get this error:
pongclock_v2_27.cpp:18:57: error: WProgram.h: No such file or directory
In file included from pongclock_v2_27.cpp:20:
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:12:24: error: WConstants.h: No such file or directory
In file included from pongclock_v2_27.cpp:20:
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:51: error: ‘boolean’ has not been declared
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:52: error: ‘boolean’ has not been declared
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:53: error: ‘boolean’ has not been declared
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:57: error: ‘byte’ has not been declared
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:58: error: ‘byte’ has not been declared
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:59: error: ‘byte’ does not name a type
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:60: error: ‘byte’ has not been declared
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/DS1307/DS1307.h:63: error: ‘byte’ does not name a type
In file included from pongclock_v2_27.cpp:21:
/Users/Flo/Desktop/Arduino.app/Contents/Resources/Java/libraries/Button/Button.h:34: error: ‘LOW’ was not declared in this scope
what did I wrong?
greets
flo
Hey Flo,
Glad you wanted to build the clock!
Looks like the Arduino software has been updated and my code no longer compiles :(
Download the older arduino IDE – version 0023 from the download page, it should work with that one.
I’ll have a look at fixing it with the new IDE.
Cheers
Nick
Hi Nick,
Great project! Would you have any example code to do just the ds1307/time display (no pong) on Sure’s DE-DP13112 32×8 display? I’ll have to build the bigger clock though (a friend saw it and fell in love ;), just have to buy the hardware …
Cheers!
Don
Hi Don,
Glad you like it. I don’t have any code to hand, your best bet would be to adapt the code that’s in the pongclock sketch itself. The display you mention looks to have the same controller chip, so it should work with the driver functions. You would need to obviously change where stuff was drawn on screen to fit the new display’s resolution of 32×8.
If you just wanted a bigger clock, Sure do a bigger version of the 2416 boards that use 5mm LEDs. I know a few people have used those with this sketch.
Cheers
Nick
Hi Nick,
Great project, I followed your instructions to the letter and had no problems. I was wondering if it was possible to incorporate an adjustable setting to turn the display off at night. I have a similar option on my Nixie clock.
Thanks again for one of the best clock projects on the net.
Hey Kevin, glad you like it.
It would be possible to dim the display if you were OK with a bit of coding. In the main clock loop you’d want something a bit like…
If (hours > 11 || hours < 6 )
{
clear_display();
update_display();
sleep(1000);
}
The above is pseudo code – it won't work as I don't have the stuff in front of me to look at, but it's the kind of thing you'd need. You can also dim the display (I use it in the code to fade the display). You could set it at a very low brightness.
Hope that points you in the right direction!
Nick
Nick
Hi,
I have tried to compile your script on arduino versions back to 21 but I keep getting the same errors. Any assistance would be appreciated:
pongclock_v2_27.cpp:1:20: error: Button.h: No such file or directory
pongclock_v2_27.cpp:2:20: error: DS1307.h: No such file or directory
pongclock_v2_27.cpp:3:18: error: Font.h: No such file or directory
pongclock_v2_27.cpp:4:21: error: ht1632c.h: No such file or directory
pongclock_v2_27:49: error: ‘Button’ does not name a type
pongclock_v2_27:50: error: ‘Button’ does not name a type
pongclock_v2_27.cpp: In function ‘void gettime()’:
pongclock_v2_27:112: error: ‘RTC’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_chipselect(byte)’:
pongclock_v2_27:123: error: ‘DEBUGPRINT’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_chipfree(byte)’:
pongclock_v2_27:129: error: ‘DEBUGPRINT’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_writebits(byte, byte)’:
pongclock_v2_27:141: error: ‘DEBUGPRINT’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_sendcmd(byte, byte)’:
pongclock_v2_27:165: error: ‘HT1632_ID_CMD’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_senddata(byte, byte, byte)’:
pongclock_v2_27:184: error: ‘HT1632_ID_WR’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_setup()’:
pongclock_v2_27:205: error: ‘HT1632_CMD_SYSON’ was not declared in this scope
pongclock_v2_27:206: error: ‘HT1632_CMD_LEDON’ was not declared in this scope
pongclock_v2_27:207: error: ‘HT1632_CMD_COMS01′ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_clear()’:
pongclock_v2_27:345: error: ‘HT1632_ID_WR’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_putchar(byte, byte, char)’:
pongclock_v2_27:386: error: ‘myfont’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_putbigchar(byte, byte, char)’:
pongclock_v2_27:413: error: ‘mybigfont’ was not declared in this scope
pongclock_v2_27:421: error: ‘mybigfont’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_puttinychar(byte, byte, char)’:
pongclock_v2_27:460: error: ‘mytinyfont’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void normal_clock()’:
pongclock_v2_27:490: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:494: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void display_date()’:
pongclock_v2_27:577: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:577: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27:656: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:656: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void fade_down()’:
pongclock_v2_27:710: error: ‘HT1632_CMD_PWM’ was not declared in this scope
pongclock_v2_27:716: error: ‘HT1632_CMD_PWM’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void fade_up()’:
pongclock_v2_27:728: error: ‘HT1632_CMD_PWM’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void button_delay(int)’:
pongclock_v2_27:743: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:743: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void pong()’:
pongclock_v2_27:800: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:804: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void word_clock()’:
pongclock_v2_27:1199: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:1203: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void jumble()’:
pongclock_v2_27:1323: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:1327: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27:1451: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void switch_mode()’:
pongclock_v2_27:1478: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void set_time()’:
pongclock_v2_27:1549: error: ‘RTC’ was not declared in this scope
pongclock_v2_27:1550: error: ‘DS1307_SEC’ was not declared in this scope
pongclock_v2_27:1551: error: ‘DS1307_MIN’ was not declared in this scope
pongclock_v2_27:1552: error: ‘DS1307_HR’ was not declared in this scope
pongclock_v2_27:1553: error: ‘DS1307_DOW’ was not declared in this scope
pongclock_v2_27:1554: error: ‘DS1307_DATE’ was not declared in this scope
pongclock_v2_27:1555: error: ‘DS1307_MTH’ was not declared in this scope
pongclock_v2_27:1556: error: ‘DS1307_YR’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘byte set_value(byte, byte, byte, byte)’:
pongclock_v2_27:1593: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:1595: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘byte set_value_dow(byte)’:
pongclock_v2_27:1634: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27:1635: error: ‘buttonB’ was not declared in this scope
Looks like it can’t find the libraries. Make sure you have put the library folders in the arching libraries folder and restarted the arduino application.
Just in case anyone else is trying to get this working on ubuntu (linux) then the following might save you tearing your hair out over the math compile errors:
http://mattgreensmith.wordpress.com/2011/11/24/installing-arduino-0023-on-ubuntu-11-10-oneiric-ocelot/
Thanks for the code, hopefully have the clock running by the end of the day!
EPIC fail! Can someone have a look at this code sheet for my RTC and see what im doing wrong?
http://www.radioddity.com/schematic/20-019-108%20RTC/
Really sorry for the hassle, but im new to ardiuno and a bit clueless as to whats going wrong!
Hi Nick,
Great project – you have inspired me to make one too :) your clock looks great, I have all the parts needed winging their way to me as well as some perspex to make a stand/case
Hey, great to hear it, love to see a pic of the finished item!
Hi Nick,
I love this clock and have built a few for the family. The last one though seems to start up at random. If i turn off with pong running it doesn’t always start with pong when i turn it on although the time is correct.. Could this be a problem with the RTC?
Have you considered incorporating a atomic clock receiver. I recently attached one to my Nixie Clock, the hardware is fairly simple but i am hopeless with code.
Thank you again for a great project.
Hey Kevin,
Glad you like the clock! That’s an interesting problem you have. It should start with pong (if I remember right!). I don’t think it would be to do with the RTC. Maybe the power supply could be doing something funny… but I would expect to see other issues if that were the case. Maybe try running it from another power source as a test.
Not had a look at the atomic receiver … where do you get those from?
Hi Nick,
I will try a different PSU but to be honest I’m stumped with this one. I get my real time modules from Pete Virica at http://www.pvelectronics.co.uk/index.php Last time i looked they were priced from £6.95. There is also some references on the site to how they work. Would be a great addition to the Pong Clock
Hi Nick,
I finally found the problem with my last clock. I’ve now designed a pcb specifically for this project called the GURDuino it has a IDC header for the ribbon cable attachement and can be powered by a voltage regulator or +5v psu. I can now use my Duemilanove just for programming.
Hey Kevin, sounds good – what was the problem.
Great to hear you are making a PCB for it.
Nick
Hi i saw this clock and have order all the stuff so i can build one myself, i was wondering if it is hard to add a thermometer mode to the clock ?
I am new to programing but i want to learn becouse you can make so much fun stuff with the arduino.
Regards Axel
Hey, glad you bought the bits. You could add a temperature sensor, but you would probably need a bit of experience coding it in to work with the clock.
There are lots of guides on the net about reading temperature with an Arduno, I would have a look at what is out there as a first step.
Nick
Hi again Nick,
Just wondering if an Arduino Pro Mini would work as well?
Hey Lucian, the Pro Mini is based on the ATMega 168 which doesn’t have enough RAM for the sketch. You would have to spend time trying to slim down the code.
Hi again Nick,
I went ahead and built the clock with the Pro Mini (the older ones were ATMega 168, the newer ones come in 328 flavor too)
http://img267.imageshack.us/img267/6254/20120330220334.jpg
Works great, I made a few adjustments like powering everything from a 7805 voltage regulator and capacitor combo (bottom left of breadboard)
May I ask a question, feel free to tell me to go and learn myself, how would I go about inserting a new mode, that just scrolls a piece of text (one of a choice of 4 say) with the cursor effect you have implemented. I’d like to trigger this every half hour?
Making the casing at the moment, will upload some pics in due course. Many thanks for the work you put in :)
Hey, great to see you got it working.
As for scrolling text, well. If you just have a short message that will fit on the screen you can adapt the display_date() function…
Something like:
void my_message()
{
char message[9]={“Hello” };
//call the flashing cursor effect for one blink at x,y pos 0,0, height 5, width 7, repeats 1
flashing_cursor(0,0,5,7,1);
//print the message
int i = 0;
while(message[i])
{
flashing_cursor(i*6,0,5,7,0);
ht1632_putchar(i*6 , 0, daynames[dow][i]);
i++;
}
}
I havent tested the above (and had a few beers) so it may not work, but you get the idea. you will need to call the my_message() funtion from the main loop. If you want it every 30 mins you would need an if statment e.g.
if (rtc[1] == 30){
my_message();
}
rtc[1] hold the minutes value.
If you want to scroll text bigger than the display, you would need to write a new routine that used ht1632_putchar and updated the positions moving each character a pixel along. The format is
ht1632_putchar(xpos, ypos, character);
Hope this helps!
Nick
Hi, i have now assembly my clock and have one problem, it dosen´t work, when i connect the usb cable to the board the power lamp goes on and one of the display is lit say clock but its missing some dots in the text, when i dissconnect power to the displays the orange lamp on arduino bord flashes every seconds so i beleve the clock function works but not the displays ?
What can i have done wrong?
regards
Hey,
Hmm, sounds like you might have something shorting out or wired wrong. The flashing every second sounds like the clock chip is OK like you say.
Try with just one display – you should get half the display working as normal.
Make sure the displays are set to CS1 and CS2 with the switches.
Nick
now i have fix the problem,it was power problem but now when i try to set the clock it wont save it, it just says 00:00 what did i do wrong?
now when the display works the flashing led is solid :/
If it forgets when you turn the power off, it sounds like the battery is not connected right. check your connections to the DS1307 again.
That could also be why the light doesn’t flash. It needs the clock chip working to flash.
Ok thanks i think its the clock chip thats broken, i shall replace it and see if it works
Now it works, it was the clock chip. Its awesome now :)
Hello !
I can not compile the program: (
Shows such errors:
pongclock_v2_27.cpp:18:57: error: WProgram.h: No such file or directory
In file included from pongclock_v2_27.cpp:20:
D:\arduino\libraries\Wire/DS1307.h:12:24: error: WConstants.h: No such file or directory
In file included from pongclock_v2_27.cpp:20:
D:\arduino\libraries\Wire/DS1307.h:51: error: ‘boolean’ has not been declared
D:\arduino\libraries\Wire/DS1307.h:52: error: ‘boolean’ has not been declared
D:\arduino\libraries\Wire/DS1307.h:53: error: ‘boolean’ has not been declared
D:\arduino\libraries\Wire/DS1307.h:57: error: ‘byte’ has not been declared
D:\arduino\libraries\Wire/DS1307.h:58: error: ‘byte’ has not been declared
D:\arduino\libraries\Wire/DS1307.h:59: error: ‘byte’ does not name a type
D:\arduino\libraries\Wire/DS1307.h:60: error: ‘byte’ has not been declared
D:\arduino\libraries\Wire/DS1307.h:63: error: ‘byte’ does not name a type
In file included from pongclock_v2_27.cpp:21:
D:\arduino\libraries\Wire/Button.h:34: error: ‘LOW’ was not declared in this scope
What version of the Arduino software are you using?
I’m using the link on your site:
Download the IDE from the Arduino Site here: Look under “Previous IDE versions” for 0023: http://www.arduino.cc/en/Main/software
Arduino 1.0 (release notes), hosted by Google Code
I think you have downloaded version 1.0. You need v0023 underneath.
Nick
I installed the 0023 version. Now there are errors:
pongclock_v2_27.cpp.o: In function `__static_initialization_and_destruction_0′:
d:/pongclock_v2_27.cpp:72: undefined reference to `Button::Button(unsigned char, unsigned char)’
d:/pongclock_v2_27.cpp:73: undefined reference to `Button::Button(unsigned char, unsigned char)’
pongclock_v2_27.cpp.o: In function `set_value_dow(unsigned char)’:
d:/pongclock_v2_27.cpp:1658: undefined reference to `Button::isPressed()’
d:/pongclock_v2_27.cpp:1657: undefined reference to `Button::uniquePress()’
pongclock_v2_27.cpp.o: In function `set_value(unsigned char, unsigned char, unsigned char, unsigned char)’:
d:/pongclock_v2_27.cpp:1618: undefined reference to `Button::isPressed()’
d:/pongclock_v2_27.cpp:1616: undefined reference to `Button::uniquePress()’
pongclock_v2_27.cpp.o: In function `switch_mode()’:
d:/pongclock_v2_27.cpp:1501: undefined reference to `Button::uniquePress()’
pongclock_v2_27.cpp.o: In function `display_date()’:
d:/pongclock_v2_27.cpp:600: undefined reference to `Button::uniquePress()’
d:/pongclock_v2_27.cpp:600: undefined reference to `Button::uniquePress()’
d:/pongclock_v2_27.cpp:679: undefined reference to `Button::uniquePress()’
pongclock_v2_27.cpp.o:d:/pongclock_v2_27.cpp:679: more undefined references to `Button::uniquePress()’ follow
Have you installed the 4 libraries? Do they appear in the menu?
in the tabs open files:
pongclock_v2_27
Button.h
DS1307.h
Font.h
ht1632c.h
Hmm. Sounds like maybe there is something up with your install, or you have accidentally typed something in the code.
I’d be tempted to remove the arduino IDE (1.0 and 0023), then the libraries folder as this can hold libraries for 0023 and 1.0 and can get confused. THen try re downloading the code from google.
Hard to say without looking at it :(
I did it !! :)
Binary sketch size: 18200 bytes (of a 30720 byte maximum)
missing library Button.cpp
Thank you for your help !
Hey good news!
What a great looking project. I have ordered the display’s and wired it up and I can get the left part of the display working on both halves of the display by changing the switches but can’t get the whole display to work. I did see it operate once but the R an L was switched around. I turned it OFF then ON again and since I have just had a one sided display. I am thinking maybe a reset pulse but thought maybe you have saw this before.
Hey, glad you like it – really cool you bought the bits. If the displays only work as left, sounds like one of the CS lines maybe isn’t working.
Check all your connections and make sure there are no loose wires / dry solder joints etc.
You should have one display with only CS1 on and the other with only CS2 on.
If they are the wrong way round, just change the switches round. I.e make the one that had CS1 on have CS2 on, and vice versa.
Cheers
Nick
Problem solved. I was running the project on a dual voltage output supply. I switched the displays and arduino stand-alone board to one supply and it works great. Must have been a difference in supply grounds or the project not resetting correctly.
Glad to hear it!
Nick, this is entirely awesome – and that is not a word I overuse! I have my first Arduino board on order and am planning to make one of these as my first project. I’m tempted to try the 32×16 Bi-colour display from Sure, here:
http://www.ebay.co.uk/itm/3216-32X16-Red-Green-3mm-Bicolor-LED-Dot-Matrix-Display-Infor-Board-HT1632C-/350549559210?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item519e61c7aa#ht_4795wt_960
This is also based on the HT1632C – so should it be relatively doable to adapt the code to the slightly smaller display? Or am I missing something? MTIA :)
Hey Matthew,
Yeah unfortunately it would be quite a lot of work to adapt the code – e.g.
- rewrite the driver code to address 1 display not two, and to write in the correct format for that bi-colour display
- rewrite the clock modes to support the reduced 32 pixel width (the 2 displays I use give 48 pixels)
- redesign the fonts to fit 32 width – i don’t think the big numbers will fit.
- add in any customisations you wanted to make it bi colour.
It’s di-able (apart from word mode which might not fit on 32 pixels) but quite a big re write.
Cheers
Nick
Nick, many thanks for the reply. I haven’t got my arduino board yet, but I downloaded and looked through your code – although I’m new to the hardware side of things, I’m a developer by day. Looks very good, commented and easy to follow – so I think doing it with a different display is doable too! Adapting it is probably a good way to learn some stuff about the Arduino too. In the unlikely event my end result is presentable, I’ll send it back to you ;)
Hey sounds great, you can correct all my dodgy coding! Be cool to see what you come up with.
Hi again Nick,
Loving my clock, it really is a nice looking bit of furnature and a good talking point. I am finding writing useful code for it a massive challenge though. I have gone from being an Arduino noob to building your clock and have missed a load of steps learning wise ;) Any pointers on where to begin with these panels? I’ve found a few threads and posts by westfw which might be helpful but any pointers welcome
Yeah the problem with the panels is you need to be a bit of a brainbox like WestFW. He looked at the schematics from Sure and worked out what needed to be set to get them going. You can have a look as a start and see what codes the driver chip accepts – various modes etc etc.
Then I just ended up playing around to learn – think of an effect you might want to do, and see how far you get!
Also, I am seeing some flickering of unlit LEDs, but only ones under blocks of several LEDs (large characters other modes are fine), my wiring seems good…
Normal?
Hey, looks like you have added to the code to get the numbers animating (nice!), it could be a result of redrawing the display a lot.
I don’t see it on mine, but then I’m not drawing the screen as much, or with big block of pixels so much.
Tricky one. If you look in the arduin forums there is an alternative method to drive the display (a post I think by WestFW) that may be better… I’ve not tried it myself though.
It looks like interference or my shoddy soldering :( I uploaded your sketch and it is still visible (under the Pong paddles for example). Then I fired up your sketch with my Uno on breadboard and it is not visible
Oh well, back to the drawing board!
Been working on dimming the clock (the highest intensity is far too bright for night time :D) with help from the Arduino forums. I’ve got two levels sorted (15 and 0) and been able to switch between them on button presses by cannibalizing code. Still working on getting the dimming function to trigger after a certain time though. Would you have any pointers?
Hi Lucian,
This guy I’ve listed has done some work on creating a dimming function, it automatically dims at midnight. Perhaps you could get some ideas from the code.
http://pcbo.dcs.aber.ac.uk/blog/projects/arduino-pong-clock/
Awesome, thank you Kevin. I had a quick look at his code, it uses a pretty different method to what I’ve started doing… As tempting as it would be to copy him I am going to figure out what I need to do on my own! :)
Hi, I saw this project and I wanted to have one! Just ordered the parts in China via american and british ebay, have them delivered to Germany within 4 weeks, and built the thing. Great! Everything works fine, but…
When I looked inside the code, I found at least two recursions, which are a NoGo in embedded programming:
Function normal_clock() calls itself in line 487, function pong() calls itself in line 797.
I have not analyzed further, but maybe you will get a stack-overflow when you press the button continously.
void normal_clock(){ …
if(buttonB.uniquePress()){
…
normal_clock();
return;
}
Do I see this correct? Or is there something special in C for Arduino, which I did not understand?
Hey, glad you bought the bits. I’ve not had a look at the code in a long while but it could well be doing things that aren’t recommended. (I’m still quite new to programming on the Arduino.)
Feel free to amend and glaring errors and let me know. I can post the update on the google code page.
Nick
I finished mine last night, but still needs a bit of work to clean up.
Hey, looks good!
Thanks Nick!
I’m hoping to expand the code to add some different modes and animations. Will share my results with you! :)
Great, be cool to see what else you can add to it!
Looks great, liking the red!
Hi Nick,
Still haven’t finished my clock and it’s been MONTHS lol. Have been adding to the code bit by bit though and have learned a lot. Thank you for the push I needed to get into Arduino :) Here is a short clip of my clock. Maybe I’ll finish it before the RTC battery runs out?!
Here it was gone 1 am so it was in dimmed mode and the RGB back light LEDs are on
Wow, LED tastic! You’ve really gone to town with the backlighting!
Heh bright aren’t they!? It’s only 4 X 3mm RGB LEDs ;)
I fired it up just to test it all without the switches. I thought it might work without them I just wouldn’t be able to set them. I fired it up and got clock v 2.27 and then it went blank. Any ideas on where it went wrong?
Also I don’t have the battery rigged up. I am running it straight to the wall cause I was thinking you didn’t need it if you had a continuous source. I also didn’t use any of the resistors that came with the kit because you didn’t show them in your schematic. I did use the 8 pin chip and have it all plugged into a board just using wires – no solder.
Should be fine without the switches, not sure about without the battery, that could well be the problem as after the startup screen it looks to the clock chip to get the time. Another hint will be if the led on pin 13 of the arduino flashes once a second. If not the clock isn’t ticking.
Not sure about resistors, I don’t know which kit they came with – if it was with the arduino shield they are usually for power LEDs. If that’s the case it shouldn’t make a difference if you use them or not.
Cheers
Nick
Pretty sure the DS1307 requires the 3v from the battery, even if it’s powered – not sure what effect it would have on the code, but you should get it connected up.
i am using this: http://www.ladyada.net/learn/breakoutplus/ds1307rtc.html it’s the complete instructions for the ds1307 that i have. I’ll go ahead and put it all together.
Hi Patrick,
I’ve used the same RTC and it works fine once all the components are connected up. The clock will work without the switches for test purposes.
Awesome! I got it working. I soldered up the chip and got everything wired up. I set the time through the computer so I didn’t really need switches to change anything. I’m buying parts for the cubes now about to start on the led cube 8x8x8. Have y’all seen prices on the all inclusive kit. It’s stupid ridiculous expensive!
Hey cool, glad it’s working!
Nick,
Im new to this arduino stuff..just trying to compile the code and its not properly working. I keep getting a code error saying that the button does not name a type. Im not sure if ive correctly saved the library folders but could you give me step by step instructions on how to do that? because i tried following the ones provided and everytime i reboot arduino it seems as if it hasnt recognized the library folder.
thanks very much,
luke
Hi Luke,
Glad you decided to have a go making the clock. What version of the Arduino software are you using? You need the older version 0023. If you can see the libraries under Sketch -> Import library after you restart the software then they are in the right place.
Cheers
Nick
I got the older one and I got everything connected and its working now. Thanks. But its really glitchy..not really sure why though..could it be the code? or is something off about the displays?
Hey, probably not the code as it works for myself and others. I would check all your connections, especially the 4 data lines to the displays and the power to the displays.
Also make sure you have a powerful enough USB supply. If it can’t provide enough juice, you may get unexpected results like glitches on the display. Maybe test it with just with one display plugged in, that would reduce the power consumption.
Hi Nick,
Neat clock. I have ordered all of the parts. Decided to load an verify the code, but I get tons of errors on my Macbook Pro. Yes, I am using a 1.0.x version of the.
I decided to try it on Win7, on my fusion VM, with 023, and it does verify.
I am curious, are you planning on updating the code for version 1.x.x anytime soon?
I once had to roll back to 1.0.1 fro some other example. It gets real messy, I hate using more than one version, especially since there is no support form the Arduino team for anything other than most current IDE.
I certainly do not have your programming skills.
Has anyone else updated your work that you know of?
Thanks for your efforts!
Hey Kirby, Glad you decided to make the clock. I had a quick look at updating the code a while back but I must admit I didn’t get very far. If someone was willing to go through and update it I’d be happy to add it to my google code page. I know it’s a pain working with different versions of the IDE.
Cheers
Nick
Hi! This is perhaps the best creation in the Arduino. I would like to do the same clocks, but I have only HT1632 matrix. : ((
I’m so confused with libraries and code programs that are here in the comments …
Could you send me an e-mail the necessary libraries and program code for matrix HT1632… Please!
Hey, glad you like the clock. Sorry but I don’t have time to re write it all for the displays you have. Buy the new ones, they aren’t that expensive!
I see no resistors? I’m a grade 12 working on a prject so im not good at this stuff, are the resistors built in to the led matrix, if not where are they?
also what type of wire is used? lke when connecting buttons or clock parts and do
I have to add resistors to that wire?
Hey any kind of wire you get at the hobby store / radioshack will do. Like stuff used in battery powered toys or whatever. You don’t need to add any resistors.
Hey, all the resistors needed are already on the LED boards so you don’t need to add any more.
Hi Nick, long time :)
Would it be possible to use different analog ports and how would I go about that? My A4/5 ports are mangled :(
NVM, I cobbled together a £2.99 ATMega328 kit and it works perfectly :)
2.99? Link? :)
I bought a few of them a while back from an eBay seller called offtherails2000, they have since gone up to £3.99 + P&P but it looks like a better kit. I got an older ATMega328p rather than the newer 328P-PU, different LEDs and one tactile button. This guy is really helpful, we’ve swapped a dozen or so Arduino related emails over the last few months, great guy
http://www.ebay.co.uk/itm/ATMEGA328-PU-ArduinoUNO-PRE-LOADED-KIT-Loose-Breadboard-Components-Kit-1-Kit-/221143775528?pt=UK_BOI_Electrical_Components_Supplies_ET&var&hash=item337d323928&_uhb=1
http://www.ebay.co.uk/sch/offtherails20000/m.html?_nkw=&_armrs=1&_from=&_ipg=&_trksid=p3686
Hello Nick!
Great project, i really like to rebuild this!
Can you by chance email or share the code for the old “non-C” Holtek HT1632 ?
I happen to have two of these display lying around and want to use them :)
Thank you for sharing this nice thing!
Regards Markus
Hi Markus, I’ve just uploaded the driver for the older style displays to my google code page. There are a few tweaks you need to do to the code that i’ve put in the description notes.
Cheers
Nick
Exactly how long did it require u to publish “Pong Clock | Nick’s LED Projects”? It offers a good deal of good info. Thanks a lot ,Genesis
An afternoon or two. Not too long!
I finished building today and downloaded the code.
It uploade to the Arduino with no error messages, but nothing is showing on my board.
I left all for code unmodified, but I am only using one board right now. Is that why nothing is showing? My second one is on the way, so if I plug in that will this work?
Or did I do something else wrong? Should something still be showing with one board?
Yes you should see half the clock with just one board. Changing the dip switch will choose which half.
Check the dip switches and check all the connections and that you have everything wired to the correct pins. Also check the clock is ticking, the arduino pin 13 LED should flash once a second.
Also check you have the new version of the display board with the chips on the back.
Hello.
I try to uploas your program in my atmega and in arduino software i have this errors:
pongclock_v2_27.pde:-1: error: ‘Button’ does not name a type
pongclock_v2_27.pde:-1: error: ‘Button’ does not name a type
pongclock_v2_27.cpp: In function ‘void gettime()’:
pongclock_v2_27.pde:-1: error: ‘RTC’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_chipselect(byte)’:
pongclock_v2_27.pde:-1: error: ‘DEBUGPRINT’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_chipfree(byte)’:
pongclock_v2_27.pde:-1: error: ‘DEBUGPRINT’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_writebits(byte, byte)’:
pongclock_v2_27.pde:-1: error: ‘DEBUGPRINT’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_sendcmd(byte, byte)’:
pongclock_v2_27.pde:-1: error: ‘HT1632_ID_CMD’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_senddata(byte, byte, byte)’:
pongclock_v2_27.pde:-1: error: ‘HT1632_ID_WR’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_setup()’:
pongclock_v2_27.pde:-1: error: ‘HT1632_CMD_SYSON’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘HT1632_CMD_LEDON’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘HT1632_CMD_COMS01′ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_clear()’:
pongclock_v2_27.pde:-1: error: ‘HT1632_ID_WR’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_putchar(byte, byte, char)’:
pongclock_v2_27.pde:-1: error: ‘myfont’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_putbigchar(byte, byte, char)’:
pongclock_v2_27.pde:-1: error: ‘mybigfont’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘mybigfont’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void ht1632_puttinychar(byte, byte, char)’:
pongclock_v2_27.pde:-1: error: ‘mytinyfont’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void normal_clock()’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void display_date()’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void fade_down()’:
pongclock_v2_27.pde:-1: error: ‘HT1632_CMD_PWM’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘HT1632_CMD_PWM’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void fade_up()’:
pongclock_v2_27.pde:-1: error: ‘HT1632_CMD_PWM’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void button_delay(int)’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void pong()’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void word_clock()’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void jumble()’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void switch_mode()’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘void set_time()’:
pongclock_v2_27.pde:-1: error: ‘RTC’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘DS1307_SEC’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘DS1307_MIN’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘DS1307_HR’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘DS1307_DOW’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘DS1307_DATE’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘DS1307_MTH’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘DS1307_YR’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘byte set_value(byte, byte, byte, byte)’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
pongclock_v2_27.cpp: In function ‘byte set_value_dow(byte)’:
pongclock_v2_27.pde:-1: error: ‘buttonA’ was not declared in this scope
pongclock_v2_27.pde:-1: error: ‘buttonB’ was not declared in this scope
What shoul i do?
Regards.
Oups!!!
I’m sorry, i used arduino 1.0.1, i downgrade it to 0.23 and now it’s ok.
Hi,
I am trying to compile your code using my macbook but I get the following errors. Can you point me in the right direction? I am using Arduino 0023 as suggested in your instructions:
pongclock_v2_27/Button.cpp.o: In function `Button::pulldown()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:48: multiple definition of `Button::pulldown()’
Button.cpp.o:Button.cpp:48: first defined here
pongclock_v2_27/Button.cpp.o: In function `Button::wasPressed()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:73: multiple definition of `Button::wasPressed()’
Button.cpp.o:Button.cpp:73: first defined here
pongclock_v2_27/Button.cpp.o: In function `Button::stateChanged()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:84: multiple definition of `Button::stateChanged()’
Button.cpp.o:Button.cpp:84: first defined here
pongclock_v2_27/Button.cpp.o: In function `Button::isPressed()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:55: multiple definition of `Button::isPressed()’
Button.cpp.o:Button.cpp:55: first defined here
pongclock_v2_27/Button.cpp.o: In function `Button::uniquePress()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:91: multiple definition of `Button::uniquePress()’
Button.cpp.o:Button.cpp:91: first defined here
pongclock_v2_27/Button.cpp.o: In function `Button::pullup()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:39: multiple definition of `Button::pullup()’
Button.cpp.o:Button.cpp:39: first defined here
pongclock_v2_27/Button.cpp.o: In function `Button’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:28: multiple definition of `Button::Button(unsigned char, unsigned char)’
Button.cpp.o:Button.cpp:28: first defined here
pongclock_v2_27/Button.cpp.o: In function `Button’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/Button.cpp:28: multiple definition of `Button::Button(unsigned char, unsigned char)’
Button.cpp.o:Button.cpp:28: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::set_sram_byte(unsigned char, int)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:209: multiple definition of `DS1307::set_sram_byte(unsigned char, int)’
DS1307.cpp.o:DS1307.cpp:209: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::set_sram_data(unsigned char*)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:186: multiple definition of `DS1307::set_sram_data(unsigned char*)’
DS1307.cpp.o:DS1307.cpp:186: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::save_rtc()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:42: multiple definition of `DS1307::save_rtc()’
DS1307.cpp.o:DS1307.cpp:42: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::start()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:164: multiple definition of `DS1307::start()’
DS1307.cpp.o:DS1307.cpp:164: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::stop()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:156: multiple definition of `DS1307::stop()’
DS1307.cpp.o:DS1307.cpp:156: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::set(int, int)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:95: multiple definition of `DS1307::set(int, int)’
DS1307.cpp.o:DS1307.cpp:95: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::get_sram_byte(int)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:199: multiple definition of `DS1307::get_sram_byte(int)’
DS1307.cpp.o:DS1307.cpp:199: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::get_sram_data(unsigned char*)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:172: multiple definition of `DS1307::get_sram_data(unsigned char*)’
DS1307.cpp.o:DS1307.cpp:172: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::read_rtc()’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:24: multiple definition of `DS1307::read_rtc()’
DS1307.cpp.o:DS1307.cpp:24: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::get(int, unsigned char)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:64: multiple definition of `DS1307::get(int, unsigned char)’
DS1307.cpp.o:DS1307.cpp:64: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::min_of_day(unsigned char)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:148: multiple definition of `DS1307::min_of_day(unsigned char)’
DS1307.cpp.o:DS1307.cpp:148: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307::get(int*, unsigned char)’:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:55: multiple definition of `DS1307::get(int*, unsigned char)’
DS1307.cpp.o:DS1307.cpp:55: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307′:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:15: multiple definition of `DS1307::DS1307()’
DS1307.cpp.o:DS1307.cpp:15: first defined here
pongclock_v2_27/DS1307.cpp.o: In function `DS1307′:
/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:15: multiple definition of `DS1307::DS1307()’
DS1307.cpp.o:DS1307.cpp:15: first defined here
pongclock_v2_27/DS1307.cpp.o:/Users/user/Documents/Arduino/libraries/pongclock_v2_27/DS1307.cpp:209: multiple definition of `RTC’
DS1307.cpp.o:DS1307.cpp:209: first defined here
Hi,
when I try to verify the coe, I receive this error:
‘myfont’ was not declared in this scope.
How can I resolve this?
Thanks, Andrea from Italy
Sounds like you don’t have the libraries in the right place. Make sure they appear in the menu like the instructions say.
any ideas on how I can get your code to run on this screen
http://www.sureelectronics.net/goods.php?id=1122
Would take a lot of re-coding. Plus it’s not big enough – not enough pixels wide.
Hello everybody.
I made my pong clock, i madea video:
http://vimeo.com/59600108
I bought this rtc:
http://www.ebay.fr/itm/New-Board-Tiny-I2C-RTC-DS1307-AT24C32-Real-Time-Clock-Module-For-AVR-ARM-PIC-/261121352297?pt=UK_BOI_Industrial_Automation_Control_ET&hash=item3ccc0ba269
But when i set the year, the clock come back to 2010.
have you got an idea?
Regards
Hey, looks great – love the case! Not sure why your RTC doesn’t set the year, it looks the same chip. Does it remember the time when it’s turned off?
You can always cheat and set the year in the software code!
Hi Nick,
Finally got all my parts, and got the clock running. Had a bit of trounle becuase I followed your illustration for wiring the DS1307, even though I really do know how to count pins on a DIP!
Clock still seems to work, though I did put a new on in to see if the Day and Year setting problem I am having went away. It did not. The clock says it is tuesday, even though it is Saturday! And when I go to try to set the time again, it says Tuesday, and the year is always 2010!
I am perplexed by this. Sometimes the day name is correct when it goes through that cursor mode thing, but mostly it is wrong. I am curious to see what it does later in the week.
Times seems ok, though I really wish there was a twelve hour number mode.
Still really fun, but I would love to know why this anomaly is happening. Interesting to see that another fellow is having the 2010 year problem that I am.
I assume that you are really supposed to see the current day and day name when you are in time setting mode?
Best wishes.
Kirby
Hi.
I get the same problem.
If i set 2013 in the year, the days (monday, tuesday…) displayed are wrong.
So i set 2010 for the year, and the clock work fine.
Hey,
Try setting the day individually, Its not clever enough to work it out from the date if I remember right.
Nick
Hey, not near the clock/code so I can’t check, but i think the clock will load up the time set in the main sketch when it goes onto set mode. It it will always be 2010 or whatever. You can change this in the code.
If I remember right, you need up set the day name too as you go through those set screens, it’s not clever enough yet to figure the day out from the date yet.
Cheers
Nick
Ahhhh, you know, that makes a great deal of sense.
I got it set now, so it is near perfect. I think I was skipping through the day and year, trying to reset the seconds to get it close as possible. I am pretty sure I set every item the last time, and that is making sense with what you have said. The dayname and year does always seem to be as you said now that I think about it. Tuesday 2010!!
The kit work marvelously now, thanks so much for sharing your work with all of us!
I wish I understood the programming better, so that I could help you update it for the newer Arduino IDE versions.
I would also love to add a few modes, I love to see seconds incrementing. Kind of like the Doomsday clock I see at Wiseduino, and Wyolum’s YouTube video.
I am running the version that another user listed here, with the animated digits, and blinking colon. I am too slow witted to use the binary clocks! I can’t add it fast enough.
Now I just need to fab a case.
Thanks again! Really really cool kit!
I’m having two problems which I believe to be related. The button folder will not unzip without errors and then I get errors when I compile about button nor being defined.
The Button folder should not need to be unzipped separately, if you unzip the main file you download then all the libraries will be ready, just drop them into the correct folder as per the instructions.
OK, I used win rar to unzip into the libraries folder but I still get an error message when I compile.
Hmm, what exactly is the error you are getting from winrar? maybe your download is corrupted somehow? Try re downloading it. Then all you should need to do is unzip that single file to see the 4 folders and code file.
Hi Nick,
I absolutely love what you have done/are doing here. I’m a web developer with a good knowledge of C# (always have been into electronics). I stumbled across your project and instantly said “Ive got myself a new hobby!”. I never heard of Arduino until i saw this post. ive been aware of electronic dev kits through college mates but didn’t think they would be capable of doing anything more than powering a buzzer connected to two LEDs. Or i have seen motion sensor robots etc.
ANYWAY:
I’m leaving this post to show my appreciation for what you have done and to say i have ordered all of the components except the RTC. I was looking at this and wondering if it would work and if so which connector is the 5v? I know the Arduino analog pin 4 connects to SDA & the Arduino analog pin 5 connects to SCL.
http://www.ebay.ie/itm/New-I2C-RTC-DS1307-AT24C32-Real-Time-Clock-Module-For-Arduino-AVR-ARM-PIC-SMD-/261121346932?pt=LH_DefaultDomain_0&hash=item3ccc0b8d74
It will probably be a month or so by the time i get all the parts and all running. Ill hopefully post a video once things are running.
Sorry, after a bit if goggling i found out that the 5v is the VCC. However my question still remains if this will work? i see it has two sides to it with P1 & P2 sets of connections. Also the fact that it comes added with an eeprom, resistors & diodes which i don’t quite understand their presence.
I’m sorry but my expertise isn’t in the hardware department, i just know enough to get me by :).
Hey James. thanks for the post, really glad you’ve been inspired to get into this stuff!
Yes Vcc is the 5v like you say. As for that particular RTC module, I can’t say for certain, but it looks like it should work. There’s no circuit diagram, but I’m guessing the RTC connects to one side of connectors, and the EEprom to the other (not sure which is which). My RTC also came with an EEprom so they are often sold together by the looks of things.
I guess you’re gambling $2 here… so maybe not the end of the world if it doesn’t pan out! Let me know how you get on.
Cheers
Nick
Yea if it doesn’t work attached to the board i can always separate the individual parts.
I wonder if you could help me with another similar project. I have removed a 7×80 color LED matrix from a text scroller. I think there was something wrong with the board attached to it, it was used to show film times above a cinema screen.
My question is: on the matrix it has a set of 10 2pin connectors in a row. It looks like your 16 pin IDC only without the plastic surround and with 20 pins. Is there any way to know or find out which pins are which. Like i said before im not a hardware person. But i would like to connect an Arduino to it and revive it as a text scroller, or maybe another clock. I know this is off topic from your clock but i would greatly appreciate your help as i cant seem to seem to find an answer online.
Thank you,
James
No fraid not. It’s impossible to say unless you can find a wiring diagram or identify the ICs and trace the pins.
Nick
Hey, Nick.
I built the clock, and I’m having trouble getting the clock set.
Once I set the time, the cursor flashes on screen for a few seconds, and then ”
0TH
Y
”
Is displayed and fades after a few seconds.
And advice?…
Thanks.
Hey Alex,
Weird one, does the time change if you leave the clock alone? If not I’d say it’s not reading the time from the clock chip, so check the connections to that.
Nick
Hey, I was able to figure out what the problem was. I wired it up exactly as it’s pictured in the schematic and didn’t read what you have right under the picture. Oops.
Hmmmm….. sounds very familiar!
Did the exact same thing myself a few weeks ago when I built mine!
The RS1307 got pretty hot….. but it still worked after I corrected that problem.
And as I mentioned earlier… I should have known better, I know how to count pins on DIP’s!!
Woo Woo! After a month of waiting on the parts they all finally arrived (With the setback of customs holding and charging me €13 for the LED matrix, Sure Electronics declared them as bottles!). I had all built in a couple of hours and it worked first time, All down to your great instructions. Thanks again Nick! Have you tried powering the clock from a battery pack and if so how long did it last?(would the 9V provided from the battery constitute as too much power as per your warning?)
Hey, great news! Glad you made it! Annoying about the LED panels though.
A 9v battery (rectangle one) Wont give enough power to run all those LEDs. You’d need a chunky battery to run it for any length of time – maybe a bunch of D cells with something to bring the voltage to 5v?
Nick
I’ve read your tutorial…great. You explained this really well. I’m waiting for the LED matrix and i want to put two pot to play pong! I’ll let you know ;)
Congratulation for your work.
Valerio
Hey, hope you have fun making it !
Hello,
Thank you for this project.
I have built one, using the 5mm displays. It seems to be working fine, however I am not getting any clock signal (time stays 00:00) I am using Grove RTC from seeed as I couldn’t get my hand on a DS1307 by itself.
Do you think my problem is because I am using Grove RTC? If yes, can I tweak the code to get it working?
The sample code project on Grove RTC doc seems to function correctly (I can see the correct time on the serial)
Thanks again for the project and for your time.
Glad you built one. That grove RTC should be fine, it just looks like a DS1307 packaged on a circuit board. Just check you have it wired up correctly, the doc I found mentions something about a base shield that plugs into the Arduino. The arduino pin 13 LED should flash once a second when it’s connected right.
Nick
Hello again,
I managed to get it to work, however there are some weird behaviors, here is how i got it to work:
1- I got an actual DS1307 and the behavior was the same as with the grove RTC.
2- The led on Arduino is always on (not flashing), however when i added a 220ohm resistor and a led on pin 13, it started flashing.
3- The set clock function in the code never works, to get it working, I had to set the time first using a code sample i found online for the DS1307, I was able to confirm this because the sample code uses the same pins as the pong clock to communicate with the DS1307 so i am sure it’s not a connection error.
When i set the clock with sample code, pong works perfectly, if i disconnect power and battery, pong shows 00:00 forever, setting the time does not work.
4- Since, the code sample I have does not set the day of the week, the clock thinks it’s always Tuesday and never updates that even when a day passes.
5- All other clock modes(apart form Pong) do not work properly:
5.a- Words mode: always shows Twelve o clock for 1 sec, then the real time for 1 sec and so on.
5.b- Jumble mode: keeps randomizing every second, using debug, the variable mins was not correct, either empty or has the wrong minute, so I changed the for loop to be “rtc[0] == 59″ instead of “mins != rtc[1]“, which seems to have fixed the problem, however the day of week was still garbage since it was not set, so i replaced the array with months, it works fine this way, however as soon as you go back to another mode, you find that the time has been stuck in the past and did not update, the only way to get it back to work is to set the time again using sample code.
5.c- Normal mode: Displays the correct time for 1 sec then displays 00:00 forever
5.d- Random mode: Seems to be okay, it’s just that most other modes do not work.
5.e- Pong mode: Works perfect, I left it overnight and the time was right, disconnect/reconnect power and time was still good.
5.f- Set clock: Only saves time, not the date/day.
5.g- Display date: Sometimes shows: ET HOUR 0TH. and sometimes shows the correct date.
Since I do not know very well Arduino nor C++ I cannot tell what/where is it going wrong, but while debugging, I can see that the rtc[] array in pong mode returns the time correctly, while in all other mode there is a parameter or two incorrect.
Have you seen anything like that before?
Thank you again for the project and for your support; And please excuse my very long post.
Achraf
Hey,
This is all very strange, I’ve never seen this behaviour. Everything should just work, you shouldn’t have to start changing odd things in the code per mode. If the time data is correct they should all be fine.
It sounds like you have a bigger issue, maybe an unstable power supply? Does it work without the displays plugged in and some debug lines, or with just one plugged in? Try and reduce the power draw. Are you powering via USB?
Do you another Arduino to test it with?
Nick
As per your advise, I tried to disconnect the second display, it seems to have worked, all modes work better now, except numbers mode, which now blinks the real time and 00:00 every second.
My arduino is powered by USB (from PC when debugging and from a 2A USB adapter when not)
My multimeter reads 470 to 480mA when both displays are connected and 500mA when only one is connected.
I unfortunately have no other Arduino to test with.
Regards,
Achraf
Solved. Simply switching to a DC adapter fixed all the problems! I don’t really understand why, I have to admit, it’s my first arduino project and I am a bit confused by this behavior.
Again, thank you for the great project and for your support.
Achraf
Ah well done. It sounded like it might have been something funny with the power. Really glad it’s working!