Microduino Snake game

From Microduino Wiki
Jump to: navigation, search
Language: English  • 中文

Outline

  • Project: Microduino Snake Game
  • Objective: Connect the mobile and Microduino-Core by Microduino BT module, then control the double color LED lattice to play snake game!
  • Difficulty: High
  • Time-consuming: 4 hours
  • Maker: Microduino Studio-YLB

First solution:

Bill of Materials

  • Microduino equipment
Module Number Function
Microduino-Core 1 Core module
Microduino-FT232R 1 Download program
Microduino-BT 1 Make connection with mobile
  • Other equipment
double color LED lattice 1 Display
Pegboard 1 Set up circuit
9_Pin Row needles 3 Fix Microduino core
Bread board jumper 4 Connect wire
Soldering iron 1 welding tool
Solder 1 welding tool
Wire 1 welding tool
tweezers 1 welding tool
3D printer 1 Print the shell

Document

IIC lattice chip: Library:

Debug

  • Step 1: Prepare the experiment equipment
Microduino Sneak all.jpg
  • Step2: Build adapter board
    • Cut a certain specification size pegboard;
    • Weld the row needles;
Microduino Sneak ok1.jpg
    • After finished welding, use the bread board to make connection, From left to right in turn is the SDA and SCL, GND, VCC;
Microduino Sneak ok2.jpg
  • Step 3: Change the lattice, because the original LED lattice doesn't easy to connect the jumper, so change its row needles match Microduino's pin.
Microduino Sneak writing.jpg
  • Step 4: Stack the module and lattice, measure the shell size.
Microduino Sneak Combination.jpg
  • Step 5: Draw the 3D shell
  • Step 6: Print 3D shell
Microduino Sneak 3D2.jpg
  • Step 7: Assembly, put all module into 3D shell
Microduino Sneak 3D4.jpg
Microduino Sneak 3D3.jpg
  • Step 8: Software debug
    • Download the library and test program
    • Select the board and serial to download after compiled it. Note, program use software Serial to debug, Software Serial mySerial(9, 10). So need change the serial pin to D9,D10 on Microduino BT module, or change the code.
    • Turn on the mobile BLE and APP, connect the Microduino and mobile, and then start to control.
Microduino Sneak android.jpg
    • Rendering
Microduino Sneak Effect1.jpg
Microduino Sneak Effect2.jpg

Result

Boot into the game after rolling Microduino, snake color is green, fruit is red. Because of the lattice is very small, won't increase the snake length, instead to increase the speed, and keep a certain high speed. When the snake hit the walls, show "GAMGOVER" and your scores, then restart again.

The issue need pay attention

  • Bread board jumper connection between pegboard and Microduino should be correct;
  • The serial communication pin between MIcroduino BT and Microduino Core can't make a mistake.

Video

http://v.youku.com/v_show/id_XNjg0MDYwNzQw.html

Second solution: Use Microduino double color lattice.

Advantage

  • Square LED lights, very beautiful
  • Microduino standard board, stack it directly
  • Microduino double color lattice's size is 60*60mm, Visual effect is better.

Bill of Materials

  • Microduino equipment
Module Number Function
Microduino-Core 1 Core module
Microduino-FT232R 1 Download program
Microduino-BT 1 Make connection with mobile
  • Other equipment
Double color LED module 1 Display
PCB 1 Set up circuit
9_Pin Row needles 6 Fix Microduino core
Soldering iron 1 welding tool
Solder 1 welding tool
Wire 1 welding tool
tweezers 1 welding tool

Debug

  • Step 1: Weld PCB
Microduino Sneak LED 1.jpg
  • Step 2: Stack module
Microduino Sneak LED 2.jpg
    • Download library and test program
    • Turn on IDE, select the board and serial, download program after compiled it.
  • Step 3: Unplug the Microduino FT232 and plug in MIcrodino BT module.
Microduino Sneak LED 3.jpg
  • Plug in the lattice
Microduino Sneak LED 4.jpg
    • Turn on the mobile BLE and APP, connect the Microduino and mobile, then start to control.
    • If connect success, Microduino BT indictor doesn't blink.
Microduino Sneak LED 5.jpg
    • Rendering

Boot to display "Microduino":

Microduino Sneak Effect 1.jpg

Start the game:

Microduino Sneak Effect 2.jpg

Result

The use of Microduino lattice will achieve a better effect.

Video

http://v.youku.com/v_show/id_XNjkyNTY5MDky.html