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 mbed PowerControl
main.h File Reference
Header file for main game containing function prototypes, namespaces and global variables. More...
Go to the source code of this file.
Namespaces | |
| namespace | serial |
serial communication with host | |
| namespace | lcd |
game screen controller | |
| namespace | leds |
Output for onboard LEDs. | |
| namespace | joystickX |
input from joystick X, on p15 | |
| namespace | joystickY |
input from joystick Y, on p16 | |
| namespace | joystickButton |
input from joystick button, on p17 | |
| namespace | buzzer |
digital output to buzzer on p5 | |
| namespace | local |
local file system | |
| namespace | gameClock |
the master clock of game operation. | |
| namespace | lowFlipper |
used for PWM speaker control, triggers pin low. | |
| namespace | highFlipper |
used for PWM speaker control, triggers pin high. | |
Functions | |
| void | mbed_reset () |
| Reset Mbed. | |
| void | advancePlatforms (int n=1) |
| Advance Platforms. | |
| bool | isBallFalling (int bY) |
| Check if ball falling. | |
| bool | isRight () |
| Is Joystick Right? | |
| bool | isLeft () |
| Is Joystick Left? | |
| bool | isUp () |
| Is Joystick Up? | |
| bool | isDown () |
| Is Joystick Down? | |
| void | clockCounter () |
| ISR - Clock Counter. | |
| bool | isBallDirClear (int dir) |
| Is Ball Direction Clear? | |
| void | endScreenController () |
| Game Over Controller. | |
| char * | recordEntryController () |
| Record Entry Controller. | |
| bool | isRecord () |
| is Record? | |
| void | highScoreEditor (char *playerInitials, bool isRecord) |
| High Score Editor. | |
| void | pauseScreenController () |
| Pause Screen Controller. | |
| void | boop () |
| PWM speaker control function. | |
| void | pwmLow () |
| Boop Helper function. | |
| void | powerSave () |
| Power Saving Mode. | |
Variables | |
| int | clockCount = 0 |
| master clock counter | |
| bool | isFirstCheck = true |
| first check in clock cycle? | |
| bool | isFirstHit = true |
| first hit on a platform? | |
| bool | isFirstSpeedUp = true |
| first game speed up? | |
| int | gameLevel = 0 |
| current game level | |
| int | gameSpeed = 41 |
| current game speed | |
| int | numPixelsToJump = 1 |
| number of pixels ball/plat moves per animation | |
| int | numPlatformShifts = 0 |
| number of times platforms shifted, used for score calculation | |
| int | pwmCount = 1000 |
| pwm count for platform collision sound | |
| char | isSound = 'Y' |
| sound toggle, 'Y' for sound enabled. | |
Detailed Description
Header file for main game containing function prototypes, namespaces and global variables.
Thomas Davies
- Date:
- May 2015
Definition in file main.h.
Function Documentation
| void advancePlatforms | ( | int | n = 1 ) |
| void boop | ( | ) |
| void clockCounter | ( | ) |
| void endScreenController | ( | ) |
| void highScoreEditor | ( | char * | playerInitials, |
| bool | isRecord | ||
| ) |
High Score Editor.
Manages highscore file and recordEntryController().
| bool isBallDirClear | ( | int | dir ) |
| bool isBallFalling | ( | int | bY ) |
| bool isDown | ( | ) |
| bool isLeft | ( | ) |
| bool isRecord | ( | ) |
| bool isRight | ( | ) |
| bool isUp | ( | ) |
| void mbed_reset | ( | ) |
Reset Mbed.
| void pauseScreenController | ( | ) |
| void powerSave | ( | ) |
| void pwmLow | ( | ) |
| char* recordEntryController | ( | ) |
Variable Documentation
| int clockCount = 0 |
| bool isFirstCheck = true |
| bool isFirstHit = true |
| bool isFirstSpeedUp = true |
| int numPixelsToJump = 1 |
| int numPlatformShifts = 0 |
Generated on Thu Jul 14 2022 20:38:02 by
1.7.2