Sei sulla pagina 1di 2

Template for Academic Projects & Labs

Title: Snake for MyRIO


Overview of what project is:
This project is a clone of the popular Snake game present on early-to-mid-2000s Nokia cell phones. It
includes a color LCD driver written in LabVIEW for FPGA.
Picture of project:

Note: the small red board in the bottom center is an accelerometer board which is not used in this project.

Video of project
http://www.youtube.com/watch?v=yAV2TduB_Yc&feature=youtu.be

Parts List:
1x Sparkfun Color LCD Breakout Board (p/n LCD-11062)
4x normally-open momentary pushbuttons. One terminal of each button is connected to a DIO pin; the
other is connected to ground. This works because the MyRIO DIO pins have built-in pull-up resistors.
Wiring Diagram:
Pinout info for Snake for Color LCD
This VI is designed for Sparkfun LCD-11062, which ues a Nokia 6100 LCD with a
Phillips chip. See the guide here:

https://www.sparkfun.com/tutorial/Nokia%206100%20LCD%20Display%20Driver.pdf
The LCD is connected to the MyRIO connector B.
Pins:
0, 1, 2: LED lights
3: Reset (active low)
4: Data
5: Clock (reads on rising edge)
6: Chip select (active low)
7, 8: buttons
The directional pad is connected to the MyRIO connector A.
Pins:
0: Up
1: Right
2: Left
3: Down
If a different pinout is desired, it should be fairly easy to modify the relevant FPGA
VIs. This will require you to recompile the FPGA VIs.
If you use a different LCD module, you will almost certainly need to modify one or
more of the following VIs:
spi.vi (FPGA VI): Change this to send a different initialization sequence upon poweron, change LCD pinout, or change to a different type of SPI (e.g. separate
Data/Command line, different # of bits per byte, etc.).
Send Bitmap.vi, Get Image Dimension Data.vi: change these to change the format
in which bitmap images are sent to the LCD.
Initialize LCD.vi: change this to change the LCD's initialization sequence.
Get Pixel Data.vi: not currently used for performance reasons, but if it was, you
would need to change this to change the format in which bitmap images are sent to
the LCD.
Instructions:
You can create your expansion board using the pinout above, or using any arbitrary pinout. The latter will
require you to make slight modifications to several VIs, as described above. Likewise, using a different
LCD module will require that you slightly modify the code to comply with communications protocol for
your new LCD, which you can find in the LCDs data sheet.
The top level VI is Snake Game.vi. Run this VI to play Snake. You can use the Deploy option to
program this VI to your MyRIO, so that it can be used without being connected to your computer. Move
the snake by pressing the directional buttons. The goal is to collect as many red pieces as possible without
allowing the snake to overlap itself. If you hit the edge of the screen, your snake will wrap around to the
other side of the screen. If your snake grows so large as to fill the entire screen, you win.
C or LV?: LabVIEW
Version of LV: 2013