Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: N5110 SDFileSystem mbed
main.h File Reference
Header file containing functions prototypes, defines and global variables. More...
Go to the source code of this file.
Namespaces | |
| namespace | red_led |
GPIO output for game-over LED. | |
| namespace | green_led |
GPIO output for game-playing LED. | |
| namespace | N5110_lcd |
GPIO output for Nokia screen. | |
| namespace | yellowLED |
GPIO output for collision warning. | |
| namespace | greenLED |
GPIO output for eating food. | |
| namespace | xPot |
GPIO output for joystick in x plane. | |
| namespace | yPot |
GPIO output for joystick in y plane. | |
| namespace | buzzer |
GPIO output for buzzer. | |
| namespace | volume |
GPIO output for potentiometer. | |
| namespace | sd |
GPIO output for SDcard. | |
Functions | |
| void | nextFrame () |
| Sets flag for bringing the next frame. | |
| void | timerTrigger () |
| Sets the bool timerDone as true. | |
| void | screenDelay (float seconds) |
| Timeout which keeps the program at one point for a while. | |
| void | greenOff () |
| Turns off external green LED. | |
| bool | checkCollision (int x, int y) |
| Checks is snake has hit wall or self. | |
| void | calibrateJoystick () |
| read default positions of the joystick to calibrate later readings | |
| void | updateJoystick () |
| read current joystick values relative to calibrated values and calculate direction depending on x,y values | |
| void | snake () |
| Contains all of the snake code. | |
Variables | |
| volatile int | playerLength |
| volatile int | playerPositionsX [maxPlayerSize] |
| volatile int | playerPositionsY [maxPlayerSize] |
| volatile int | areaWidth = 41 |
| volatile int | areaHeight = 19 |
Detailed Description
Header file containing functions prototypes, defines and global variables.
- Date:
- April 20156
Definition in file main.h.
Function Documentation
| void calibrateJoystick | ( | ) |
| bool checkCollision | ( | int | x, |
| int | y | ||
| ) |
| void screenDelay | ( | float | seconds ) |
| void updateJoystick | ( | ) |
Variable Documentation
| volatile int areaHeight = 19 |
| volatile int playerLength |
| volatile int playerPositionsX[maxPlayerSize] |
| volatile int playerPositionsY[maxPlayerSize] |
Generated on Thu Jul 14 2022 13:33:05 by
1.7.2