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: mbed
Diff: Menu/Menu.h
- Revision:
- 21:60f01b17b0a6
- Parent:
- 17:358987e9f30e
- Child:
- 22:028f1627c262
diff -r fe235c124c67 -r 60f01b17b0a6 Menu/Menu.h --- a/Menu/Menu.h Fri May 22 21:11:12 2020 +0000 +++ b/Menu/Menu.h Sat May 23 14:40:40 2020 +0000 @@ -16,44 +16,92 @@ { public://----------------------------------------------------------------------- //variables - //methods - //constructor + /**constructor */ Menu(); - //destructior + /**destructor */ ~Menu(); - //runs main menu code + /**runs main menu code + * @manages all main menu code and runs continually once called + */ void mainmenu(N5110 &lcd, Gamepad &pad); //sub menus + /** Waveform submenu function + * @Runs Waveform submenu code + */ void subwaveforms(N5110 &lcd, Gamepad &pad); + + /** Instructions submenu function + * @Runs Instruction submenu code + */ void subinstructions(N5110 &lcd, Gamepad &pad); + + /** Credits submenu function + * @Runs Credits submenu code + */ void subcredits(N5110 &lcd, Gamepad &pad); + + /** Settings submenu function + * @Runs Settings submenu code + */ void subsettings(N5110 &lcd, Gamepad &pad); + + /** Scrolling function + * @Function controlling scrolling in menus + * @checks doesnt exceed bounds + * @returns int value of menu item selected + */ int scroll(N5110 &lcd, Gamepad &pad, int submenu, int menusize); + + /** Volume adjust function + * @Runs Volume adjustment code + */ void volumerun(N5110 &lcd, Gamepad &pad); + + /** MIDI settings submenu function + * @Runs MIDI Settings submenu code + */ void MIDIsettings(N5110 &lcd, Gamepad &pad); + + /** Contrast adjust function + * @Runs Contrast adjustment code + */ void contrastrun(N5110 &lcd, Gamepad &pad); private: //--------------------------------------------------------------------- + //variables - int menuflag; - int g_selecty; - int submenu; - int menusize; - float contrast; - enum d; - int s; - int s_1; + int menuflag; //flag to keep in menu loop + int g_selecty; //variable to manage select box y coordinate + int submenu; //submenu selected var + int menusize; //size of each menu + float contrast; //contrast float + enum d; //direction + int s; //current direction as int + int s_1; //previous direction as int //Methods - void printmainmenu(N5110 &lcd); //prints menu - void printsubwaveforms(N5110 &lcd); //prints subwaveforms menu - void printsubsettings(N5110 &lcd); //prints settings submenu - void printcontrast(N5110 &lcd, float contrast); //prints contrast seting + /** Prints Main Menu to LCD */ + void printmainmenu(N5110 &lcd); + + /** Prints Waveforms Submenu to LCD */ + void printsubwaveforms(N5110 &lcd); + + /** Prints Settings Submenu to LCD */ + void printsubsettings(N5110 &lcd); + + /** Prints Contrast adjust screen to LCD */ + void printcontrast(N5110 &lcd, float contrast); + + /**Prints if submenu par is unavailable */ void subunavailiable(N5110 &lcd); //prints error for sub + + /*Function checks for joystick movement + * @returns intiger value of scroll direction + */ int scroll_check(Gamepad &pad); };