Recent Changes - Search:

Axon microserver

InterplayMedium Hardware

LED tetris game (based on MAX72XX LED driver) cookbook


This instruction is applied to Arduino Diecimila, but most probably it will work on Deumelianove as well. You may need to change connection on other AVR devices. In the source code you can find the original AVR microcontroller pinout reference.

1. Download required files:

  1. Source code and scripts
  2. Schematics (please read this related letter on Ardiuino website)
  3. PCB

Tetris was written on C. To compile and flash it, you need to install the following packages:

sudo apt-get install avrdude
sudo apt-get install avr-libc
sudo apt-get install gcc-avr

Additionally to these packages, I recommend you to install original Arduino framework. It contains original avrdude config. Would be easier to use it in the flash script (see bellow).

2. Fabricate PCB, solder LEDs and wire it correctly to Arduino

LED PCB pinout GND Click CS load Din Snd +5v
Arduino pins GND 13 12 11 10 +5v

Attention! Additionally to this you need to pull-up reset pin to prevent resetting during serial incoming communication (this is Arduino specifics). So, include (aprox.) 120 Ohm resistor between reset and power pins.

3. Compile it and flash the Arduino

try ls -l /dev/serial/by-id/ to find out the correct device name

Please check DEFINES, CONF and DUDE variables in "make" and "flash168" scripts. CONF and DUDE should point to the correct avrdude.conf and avrdude binary, respectively. Also don't forget to change serial device name, if necessary. Then compile it, connect you Arduino board and flash the binary.

./make
./flash

Please note, that you need to reset Arduino just in time to flash Arduino with avrdude. Arduino runs bootloader on start and waits quite for a short period of time for firmware to upload. So just press reset button right before running "flash" script!

In case of success, you could see nice shifted diagonal stripes runs on LED matrix.

Test the game

test it by running screen <path to your device> 9600

Use arrows keys to play.

Additional stuff

Additionally to that, you can find some extra graphic files for a nice InterplayMedium LED matrix wrapper and stickers in the same place.

By the way, you can create several matrices, cascade it and expand gameplay area. To run several matrices simultaneously, just change the number of matrices (#define INUSE) in the source code, recompile it and reflash the microcontroller.

Page last modified on July 07, 2012, at 04:36 PM