[vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Introduction” tab_id=”1395899228-1-70″][vc_column_text]Snake game is a very popular game. A snake is crawling in a compound wall, some food show up randomly in the wall. Use the arrow keys on your keyboard to direct the snake around the screen and eat the food. The more food the snake eats, the longer it will become. The snake’s movement should not be restricted by an obstacle or its own body. Otherwise, game over!
We can use pcDuino ADC function to sense direction by Joystick Sensor Module.There are two Sensor Module images as below, they are two potentiometers and one button.
[/vc_column_text][/vc_tab][vc_tab title=”Wiring Diagram” tab_id=”1395899228-2-87″][vc_column_text][/vc_column_text][/vc_tab][vc_tab title=”Running interface” tab_id=”1395906018237-2-9″][vc_column_text][/vc_column_text][/vc_tab][vc_tab title=”Source Code” tab_id=”1395906088847-3-6″][vc_column_text]Instruction:
(click to download snake source code )
1. Copy this folder to pcduino
2. Open the command window and enter the folder, execute make all, if no permission, running as an dministrator, if appears can’t find curses.h , need to install curses library.
Enter the following command to install curses library: sudo apt-get install libncurses5-dev.
3. The Makefile ARDUINO_PATH variable is the Arduino installation directory. Can be modified according to the real situation[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.