Difference between revisions of "Microduino Snake game"

From Microduino Wiki
Jump to: navigation, search
(Bill of Materials)
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
 
|
 
|
 
==Outline==
 
==Outline==
*Project:Microduino Snake Game
+
*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!
+
*Objective: Connect the mobile and Microduino-Core by Microduino BT module, then control the double color LED lattice to play snake game!
*Difficulty:High
+
*Difficulty: High
*Time-consuming:4 hours
+
*Time-consuming: 4 hours
*Maker:Microduino Studio-YLB
+
*Maker: Microduino Studio-YLB
  
 
First solution:
 
First solution:
Line 22: Line 22:
 
|Microduino-FT232R ||1||Download program
 
|Microduino-FT232R ||1||Download program
 
|-
 
|-
|Microduino-BT ||1||Make connectin with mobile
+
|Microduino-BT ||1||Make connection with mobile
 
|}
 
|}
 
*Other equipment
 
*Other equipment
Line 48: Line 48:
  
 
==Document==
 
==Document==
IIC lattice chip:
+
IIC lattice chip:
Library:
+
Library:
  
 
==Debug==
 
==Debug==
*Step 1:Prepare the experiment equipment
+
*Step 1: Prepare the experiment equipment
 
[[File:Microduino_Sneak_all.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_all.jpg||600px|center|thumb]]
  
*Step2:Build adapter board
+
*Step2: Build adapter board
 
**Cut a certain specification size pegboard;
 
**Cut a certain specification size pegboard;
**Weld the row needles;
+
**Weld the row needles;
 
[[File:Microduino_Sneak_ok1.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_ok1.jpg||600px|center|thumb]]
**After finished weldign, use the bread board to make connection, From left to right in turn is the SDA and SCL, GND, VCC.;
+
**After finished welding, use the bread board to make connection, From left to right in turn is the SDA and SCL, GND, VCC;
 
[[File:Microduino_Sneak_ok2.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_ok2.jpg||600px|center|thumb]]
  
*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.
+
*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.
  
 
[[File:Microduino_Sneak_writing.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_writing.jpg||600px|center|thumb]]
*Step 4:Stack the module and lattice, measure the shell size.
+
*Step 4: Stack the module and lattice, measure the shell size.
 
[[File:Microduino_Sneak_Combination.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_Combination.jpg||600px|center|thumb]]
  
*Step 5:Draw the 3D shell
+
*Step 5: Draw the 3D shell
  
*Step 6:Print 3D shell
+
*Step 6: Print 3D shell
 
[[File:Microduino_Sneak_3D2.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_3D2.jpg||600px|center|thumb]]
  
*Step 7:Assembly, put all module into 3D shell
+
*Step 7: Assembly, put all module into 3D shell
 
[[File:Microduino_Sneak_3D4.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_3D4.jpg||600px|center|thumb]]
  
 
[[File:Microduino_Sneak_3D3.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_3D3.jpg||600px|center|thumb]]
*Step 8:Software debug
+
*Step 8: Software debug
 
**Download the library and test program
 
**Download the library and test program
**Select the board and serial to download after compiled it. Note, program use softwareSerial to debug, SoftwareSerial mySerial(9, 10). So need change the serial pin to D9,D10 on Microduino BT module, or change the code.
+
**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.
 
**Turn on the mobile BLE and APP, connect the Microduino and mobile, and then start to control.
 
[[File:Microduino_Sneak_android.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_android.jpg||600px|center|thumb]]
Line 96: Line 96:
 
http://v.youku.com/v_show/id_XNjg0MDYwNzQw.html
 
http://v.youku.com/v_show/id_XNjg0MDYwNzQw.html
  
Second solution:
+
Second solution:
 
Use Microduino double color lattice.
 
Use Microduino double color lattice.
 
==Advantage==
 
==Advantage==
Line 112: Line 112:
 
|Microduino-FT232R ||1||Download program
 
|Microduino-FT232R ||1||Download program
 
|-
 
|-
|Microduino-BT ||1||Make connectin with mobile
+
|Microduino-BT ||1||Make connection with mobile
 
|}
 
|}
 
*Other equipment
 
*Other equipment
Line 134: Line 134:
  
 
==Debug==
 
==Debug==
*Step 1:Weld PCB
+
*Step 1: Weld PCB
 
[[File:Microduino_Sneak_LED_1.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_LED_1.jpg||600px|center|thumb]]
*Step 2:Stack module
+
*Step 2: Stack module
 
[[File:Microduino_Sneak_LED_2.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_LED_2.jpg||600px|center|thumb]]
 
**Download library and test program
 
**Download library and test program
 
**Turn on IDE, select the board and serial, download program after compiled it.
 
**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.
+
*Step 3: Unplug the Microduino FT232 and plug in MIcrodino BT module.
 
[[File:Microduino_Sneak_LED_3.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_LED_3.jpg||600px|center|thumb]]
 
*Plug in the lattice
 
*Plug in the lattice
Line 148: Line 148:
 
[[File:Microduino_Sneak_LED_5.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_LED_5.jpg||600px|center|thumb]]
 
**Rendering
 
**Rendering
Boot to display “Microduino”:
+
Boot to display "Microduino":
 
[[File:Microduino_Sneak_Effect_1.jpg||600px|center|thumb]]
 
[[File:Microduino_Sneak_Effect_1.jpg||600px|center|thumb]]
 
Start the game:
 
Start the game:
Line 154: Line 154:
  
 
==Result==
 
==Result==
The effect is better using Microduino lattice!
+
The use of Microduino lattice will achieve a better effect.
 +
 
 
==Video==
 
==Video==
 
http://v.youku.com/v_show/id_XNjkyNTY5MDky.html
 
http://v.youku.com/v_show/id_XNjkyNTY5MDky.html
 
|}
 
|}

Latest revision as of 09:23, 12 September 2016

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