[vc_row][vc_column width=”1/1″][vc_column_text]In this tutorial, we are going to show how to run a game named “Snake” on pcDuino, and controlled by Linker JoyStick Module.[/vc_column_text][vc_tour interval=”0″][vc_tab title=”About the Game Snake” tab_id=”1383211299-1-21″][vc_column_text]Snake is a classic casual video game that many people love and are familiar with.
The player controls a long, thin creature, resembling a snake, which roams around on a bordered plane, picking up food (or some other item), trying to avoid hitting its own tail or the “walls” that surround the playing area. Each time the snake eats a piece of food, its tail grows longer, making the game increasingly difficult. The user controls the direction of the snake’s head (up, down, left, or right), and the snake’s body follows. The player cannot stop the snake from moving while the game is in progress, and cannot make the snake go in reverse.[/vc_column_text][/vc_tab][vc_tab title=”Wire Diagram” tab_id=”1383211299-2-66″][vc_column_text]
The JoyStick is connected as following:
- GND of JoyStick -> GND of pcDuino
- VCC of JoyStick -> 3.3V of pcDuino
- x of JoyStick -> A2 of pcDuino
- y of JoyStick -> A3 of pcDuino
[/vc_column_text][/vc_tab][vc_tab title=”Running Interface” tab_id=”1383212978472-2-0″][vc_column_text][/vc_column_text][/vc_tab][vc_tab title=”Source Code” tab_id=”1383213022467-3-2″][vc_column_text]State:
download the source code :snake
1:copy the file to pcduino.
2:open the command window and enter the file, execute the make all,
run as the manager if tip no permission, install curse library if tip can’t find
the curses.h.
input this command to install the curses library:
sudo apt-get install libncurses5-dev
3: ARDUINO_PATH variable in Makefile is the install directory of arduino.
You can modify it according to the actual conditions
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.