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.
Options_Engine/OptionsEngine.h@22:4e305ff8a050, 2019-04-18 (annotated)
- Committer:
- JamesCummins
- Date:
- Thu Apr 18 11:50:53 2019 +0000
- Revision:
- 22:4e305ff8a050
- Child:
- 23:61fa82f76808
Options Menu appears to be working. Change Brightness working (other than that it skips 0.7???) Need to complete adjust ball speed and high scores list. (Still need to save to SD card somehow)
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| JamesCummins | 22:4e305ff8a050 | 1 | #ifndef OPTIONSENGINE_H |
| JamesCummins | 22:4e305ff8a050 | 2 | #define OPTIONSENGINE_H |
| JamesCummins | 22:4e305ff8a050 | 3 | |
| JamesCummins | 22:4e305ff8a050 | 4 | #include "mbed.h" |
| JamesCummins | 22:4e305ff8a050 | 5 | #include "Gamepad.h" |
| JamesCummins | 22:4e305ff8a050 | 6 | #include "N5110.h" |
| JamesCummins | 22:4e305ff8a050 | 7 | #include "Ball.h" |
| JamesCummins | 22:4e305ff8a050 | 8 | |
| JamesCummins | 22:4e305ff8a050 | 9 | enum Option{ |
| JamesCummins | 22:4e305ff8a050 | 10 | BRIGHTNESS, |
| JamesCummins | 22:4e305ff8a050 | 11 | BALL_SPEED, |
| JamesCummins | 22:4e305ff8a050 | 12 | HIGH_SCORES |
| JamesCummins | 22:4e305ff8a050 | 13 | }; |
| JamesCummins | 22:4e305ff8a050 | 14 | |
| JamesCummins | 22:4e305ff8a050 | 15 | struct OptionSelection{ |
| JamesCummins | 22:4e305ff8a050 | 16 | int output; |
| JamesCummins | 22:4e305ff8a050 | 17 | Option next_state[3]; |
| JamesCummins | 22:4e305ff8a050 | 18 | }; |
| JamesCummins | 22:4e305ff8a050 | 19 | |
| JamesCummins | 22:4e305ff8a050 | 20 | class OptionsEngine { |
| JamesCummins | 22:4e305ff8a050 | 21 | |
| JamesCummins | 22:4e305ff8a050 | 22 | public: |
| JamesCummins | 22:4e305ff8a050 | 23 | OptionsEngine(); //constructor |
| JamesCummins | 22:4e305ff8a050 | 24 | ~OptionsEngine(); //destructor |
| JamesCummins | 22:4e305ff8a050 | 25 | void init(); //initialiser |
| JamesCummins | 22:4e305ff8a050 | 26 | void options_menu(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 27 | void change_brightness(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 28 | |
| JamesCummins | 22:4e305ff8a050 | 29 | private: |
| JamesCummins | 22:4e305ff8a050 | 30 | void display_options(N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 31 | Option option_selection(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 32 | void read_brightness_input(Gamepad &gamepad); |
| JamesCummins | 22:4e305ff8a050 | 33 | Option _state; |
| JamesCummins | 22:4e305ff8a050 | 34 | int _next_state; |
| JamesCummins | 22:4e305ff8a050 | 35 | float _brightness; |
| JamesCummins | 22:4e305ff8a050 | 36 | int _ball_speed; |
| JamesCummins | 22:4e305ff8a050 | 37 | Ball _ball; |
| JamesCummins | 22:4e305ff8a050 | 38 | |
| JamesCummins | 22:4e305ff8a050 | 39 | }; |
| JamesCummins | 22:4e305ff8a050 | 40 | #endif |