Code 21

Rules

Code 21 Rules

 

Additional Support

When working on larger projects it is easier to divide the problem in smaller pieces.  Solving a series of smaller problems often allows for a more efficient problem solution in contrast to tackling the entire problem at once.  I would suggest the completing the following steps to complete this project.

 Run the screen demo code on the proto-type board.  It can be found under Files/Examples/HT1632 menu in the Arduino IDE.  If you are using your own computer, you will need install Arduino.  You will also need to install the drivers for the 16x24 LED board.  Information on the display can be found at:   https://www.adafruit.com/product/555

 

Aurduino Libraries

You need download two Arduino libraries for the display from Github:

https://github.com/adafruit/Adafruit-GFX-Library

https://github.com/adafruit/HT1632

Initially, you should build off the "matrixshapes" demo code using the matrix.drawpixel command.

 

Arudino Help

Using the search box on the Arduino.cc homepage will be very beneficial.  

 

Implement and test the pushbutton. 

When attaching a pushbutton to a microcontroller it is important to prevent shorting your power supplied to the button directly to ground.  It is also important to prevent a "floating".  To do this you can either use a pull-up or pull-down resistor in your button circuit.  The following tutorial explains pull-up and pull-down resistors:  https://learn.sparkfun.com/tutorials/pull-up-resistors

You will need to use the digital read statement to read the input pin on the Arduino.  The following tutorial explains how to implement the digital read statement on an Arduino:  https://www.arduino.cc/en/Reference/DigitalRead

To test and troubleshoot your circuit, it may be beneficial to use the serial monitor.  This will allow you to print values to your computer screen.  The following tutorial demonstrates how to use a pushbutton circuit and print the value to the serial monitor:  https://www.arduino.cc/en/Tutorial/DigitalReadSerial

 

Implement and test the joystick

The joystick on the board is a Parallax 2-axis joystick.  Documentation can be found at the following link:  https://www.parallax.com/sites/default/files/downloads/27800-2-Axis-Joystick-Documentation-v1.2.pdf

You will need to use the analog read statement to read the input pin on the Arduino.  The following tutorial explains how to implement the analog read statement on an Arduino:  https://www.arduino.cc/en/Reference/AnalogRead

It is also suggested that you use the serial monitor to verify the functionality of the joystick.

 

Screen Graphics

You should only write or update the screen at the end of the void loop function in Arudino.  Include a delay after the screen write to control the framerate of you video game.  It is suggested that your update the screen at roughly 30 frames per second.  This would be a delay of 33 ms.  

 

Sound 

You may use a single pizeo element.  The following code will help you implement a buzzer. Sample Code.  Download the .txt file and paste into the Arduino editor.

Also the following tutorial may be helpful.  https://www.arduino.cc/en/Tutorial/PlayMelody