Simple fish eat program
Dependencies: mbed mbed-rtos N5110 ShiftReg Tone
classes/Settings.h@6:7aafcaf7cbe2, 2021-03-25 (annotated)
- Committer:
- el18a2k
- Date:
- Thu Mar 25 11:31:57 2021 +0000
- Revision:
- 6:7aafcaf7cbe2
- Child:
- 8:fe51fbf81dee
restructured (implement sound on/off)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el18a2k | 6:7aafcaf7cbe2 | 1 | #ifndef SETTINGS_H |
el18a2k | 6:7aafcaf7cbe2 | 2 | #define SETTINGS_H |
el18a2k | 6:7aafcaf7cbe2 | 3 | |
el18a2k | 6:7aafcaf7cbe2 | 4 | #include "rtos.h" //allows multiple threads to run at the same time: https://os.mbed.com/handbook/RTOS |
el18a2k | 6:7aafcaf7cbe2 | 5 | #include "N5110.h" |
el18a2k | 6:7aafcaf7cbe2 | 6 | #include "Tone.h" |
el18a2k | 6:7aafcaf7cbe2 | 7 | #include "ShiftReg.h" |
el18a2k | 6:7aafcaf7cbe2 | 8 | #include "Joystick.h" |
el18a2k | 6:7aafcaf7cbe2 | 9 | |
el18a2k | 6:7aafcaf7cbe2 | 10 | #include "Sound.h" |
el18a2k | 6:7aafcaf7cbe2 | 11 | |
el18a2k | 6:7aafcaf7cbe2 | 12 | class Settings { |
el18a2k | 6:7aafcaf7cbe2 | 13 | |
el18a2k | 6:7aafcaf7cbe2 | 14 | public: |
el18a2k | 6:7aafcaf7cbe2 | 15 | //initialise system |
el18a2k | 6:7aafcaf7cbe2 | 16 | void systemINIT(N5110 &lcd, Tone &dac, Joystick &joystick); |
el18a2k | 6:7aafcaf7cbe2 | 17 | |
el18a2k | 6:7aafcaf7cbe2 | 18 | //read button A |
el18a2k | 6:7aafcaf7cbe2 | 19 | int buttonA_state(int ButtonA); |
el18a2k | 6:7aafcaf7cbe2 | 20 | |
el18a2k | 6:7aafcaf7cbe2 | 21 | //read button B |
el18a2k | 6:7aafcaf7cbe2 | 22 | int buttonB_state(int ButtonB); |
el18a2k | 6:7aafcaf7cbe2 | 23 | |
el18a2k | 6:7aafcaf7cbe2 | 24 | //sound start |
el18a2k | 6:7aafcaf7cbe2 | 25 | |
el18a2k | 6:7aafcaf7cbe2 | 26 | //settings menu |
el18a2k | 6:7aafcaf7cbe2 | 27 | int settingsMenu(N5110 &lcd, Tone &dac, Joystick &joystick); |
el18a2k | 6:7aafcaf7cbe2 | 28 | |
el18a2k | 6:7aafcaf7cbe2 | 29 | //sound off |
el18a2k | 6:7aafcaf7cbe2 | 30 | |
el18a2k | 6:7aafcaf7cbe2 | 31 | private: |
el18a2k | 6:7aafcaf7cbe2 | 32 | int ButtonA; |
el18a2k | 6:7aafcaf7cbe2 | 33 | int ButtonB; |
el18a2k | 6:7aafcaf7cbe2 | 34 | }; |
el18a2k | 6:7aafcaf7cbe2 | 35 | |
el18a2k | 6:7aafcaf7cbe2 | 36 | #endif |