Clock, and Games console, Pong, Snake and Tetris.

First I must thank all the contributors on this forum, if i hadn't been able to read through all the great information here I wouldn't have had been able to work out the different requirements I needed such as controlling displays to build this project.

I decided to build for my son a simple Pong game using 6 off 8x8 LED matrix displays. This then grew into a Clock, Alarm clock, Snake Game and Tetris Game. It's up and running now just need to get it into a box.

The Clock is Hrs and Min with a rotating LED for the seconds and the date is month, day. There just happen to be exactly 60 LEDs around the three 8x8 LED matrix displays where the date is displayed so I used this to rotate the seconds around the LEDs.
From the clock using the IR control you can:
- set the time for the alarm
- set the volume of the alarm and the game bleeps, and
- set the brightness of the display.

Snake is as per the normal Nokia phone game where you eat the apples and the snake grows. You have to avoid bumping into yourself or the walls. It gets faster as it grows and is controlled by the IR remote control arrow buttons.

Pong is played as one or two players and is controlled by two variable potentiometers to move the bats. The ball again gets faster the longer you play.

For Tetris I just used the middle two matrix displays for the game area and show the top score and current score on the sides. It is all one colour but it still plays well with the IR as the control to rotate the pieces, move from side to side or move them quickly downward. Tetris took me a while to work out especially collision testing and how to spot a complete row and then remove it and move the rows above downwards. I only just squeezed it into one program slot on the PICAXE.

Components used are
- Picaxe-28X2 Module,
- DS1307 Clock,
- EEPROM to store things like the character sets to display numbers and words along with top scores etc,
- MCP4131 digital potentiometer for a very basic volume control,
- 6 off MAX7219's to drive the displays,
- Two standard potentiometers connected via USB cables to play Pong.

Happy to share the code bugs and all! if its of interest but there is quite a lot of it so not sure if I can post it here?

Video of the clock and games.
 

Attachments

Last edited:

Andrei IRL

Senior Member
Looks like an absolutely amazing project. I could only wish i was as talented as you to make something as cool as this. Well done.
 

westaust55

Moderator
Well done on you project.

Your desciption as one large block of text was rather hard on the eyes so I hope you dn't mind that I took some liberty to use Moderators access and change the description into several paragraphs and lists.

Yes, please post your code.
Even if no one has immediate need it becomes a resource for others to use at a future date.
Someone may desire just to extract one of the games or whatever for their own "mini" project.
There are limits on the size of a post (no of characters) so you will likely do better to attach as a .BAS file from the PE. Even there you may have to break it down over two posts depending on the size of the single file.
 

MPep

Senior Member
What a amazing project.
Please do share your code. As mentioned, even if no-one else duplicates this project, people can and do study programming techniques, tricks etc.
 

Jamster

Senior Member
Awesome project :D

I was going to do similar at some point but make it so that the matrixes could be split etc and reordered to make them do different things :)
 
Thanks for the kind comments. I wrote the code in this order Pong, Clock, Snake, and last Tetris.

I took some of the ideas from each program into the next and rewrote other areas in different ways as I tried out different options for both hardware and software as I learnt more of the things that were possible. The upshot is that I'm sure if I was to write any of these again I'd do it quite a bit more elegantly however they do work even if they may be a little strange in places.

Each program is stored in a different program slot of the 28X2 with the clock in slot 0. The IR is used to select which program to run.

Hope they are useful
 

Attachments

Tetris Game, Single colour but still play ok. I store all the different rotated positions for each shape type rather than calculate the change in position.
 

Attachments

bogbean

Well-known member
I have repackaged this excellent project by Howardandhopkins to run tetris on a handheld console that is essentially a 28X2 driving LED arrays using three MAX7219s.

If anybody would like to build one of these I can provide gerber files that would allow you to get the PCBs made cheaply. The LED arrays and MAX7219s are harvested from modules readily available on auction sites.

C4 and C5 are included to be used with a bare 16MHz crystal. They may be omitted if a 16MHz resonator is used. I find the bare crystal was easier to source but made a board that could accept both options.

Currently slot 0 runs a scoreboard that shows the initials of the high-scoring players. Slot 1 runs the game. The other slots are currently unused but it would be rude not to try to get snake and pong working too.
 

Attachments

Top