36
CONWAY’S GAME OF LIFE ON ARDUINO A 48x32 led matrix controlled by an Arduino able to project output from arbitrary sources (e.g. game of life)

Conway’s game of life on arduino

Embed Size (px)

DESCRIPTION

Project with Arduino Mega and 3 led boards.

Citation preview

  • 1.Conways game of life on Arduino
    A 48x32 led matrix controlled by an Arduino able to project output from arbitrary sources (e.g. game of life)

2. Goal
To make a led matrix on which Conways game of life can run
And enable it to display other stuff, like
Ticker tape
Clock
Temperature
Menu navigation?
3. Conways game of life
World is a grid(x, y)
Each cell is alive or dead
Each iteration for each cell = grid(x, y):
If cell is alive,
It dies from loneliness if it has < 3 alive neighbors
It dies from food shortage if it has > 4 alive neighbors
It stays alive if it has 3 alive neighbors
If cell is dead,
It reincarnates if it has exactly 3 alive neighbors
4. Setup
Arduino
3 Led matrices (3 x 4x2(8x8), incl 2 controllers)
Breadboard
Wires, some resistors, leds and buttons
For fun
Thermometer
Clock
5. Arduino specs
6. ARDUINO SPECS
Microcontroller: ATmega2560
Flash memory: 256 kB
(of which 8 kB is used by bootloader)
SRAM: 8 kB
EEPROM: 4 kB
Clock speed: 16 MHz
7. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
8. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
9. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
10. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
11. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
12. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
13. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
14. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
15. Arduino specs
54 digital input/output pins
16 analog inputs
4 UARTs (hardware serial ports)
16 MHz crystal oscillator
USB connection
ICSP header
Reset button
16. Wiring the system
Solder?
17. Wiring the system
Solder?
18. Wiring the system
Breadboard!
19. Wiring the system
Breadboard!
20. Wiring the system
Breadboard!
21. Buttons
Initialize game of life world
22. Buttons
Initialize game of life world
23. LED boards
24. LED boards
?
25. LED boards
No memory on controller board
Consequence: fast refresh rate needed
External power supply (5V)
16 pin connector
26. LED BOARDS
27. LED BOARDS
28. LED BOARD PROTOCOL
Serial data transfer
Devided into 2 halves (UDAT, LDAT)
Clock and A[2..0] to control the leds
No state-memory
29. LED BOARD PROTOCOL
30. LED BOARD PROTOCOL example
Psuedo-code for controlling the LED-board
31. THERMOMETER
Component: DS1820
32. Clock (RTC)
Solder time!
33. Programming arduino
Download SDK from Arduino website.
Based on Processing SDK
Write program:
void Setup() {}
void Loop() {}
Upload to Arduino (USB) and run
Monitor by serial data transfer (USB)
34. Programming arduino
Problem #1:
Memory too small to hold 2xLED matrix array representationAND a 3x5 font map
Problem #2:
Arduinotoo slow to fluently display Game of Life
35. DEMO
36. More info
Conways Game of Life
http://www.edesign.nl/2010/04/22/the-game-of-office-decoration/
Arduino Mega
http://arduino.cc/en/Main/ArduinoBoardMega2560