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 FATFileSystem
Menu/Menu.h
- Committer:
- ellisbhastroud
- Date:
- 2019-05-03
- Revision:
- 12:7f7fadb5c106
- Parent:
- 5:0b31909caf7f
- Child:
- 13:681192091568
File content as of revision 12:7f7fadb5c106:
#ifndef MENU_H
#define MENU_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
/** Menu Class
* @brief Library for navigating menu options
* @author Ellis Blackford Stroud
* @date May, 2018
*/
class Menu {
public:
/** Constructor */
Menu();
/** Destructor */
~Menu();
/** Sets class variables initial values */
void init();
/** Prints opening message */
void print_welcome(N5110 &lcd);
/** Prints menu screen */
void menu_screen(Gamepad &pad, N5110 &lcd);
/** Prints start screen */
bool start_screen(N5110 &lcd, Gamepad &pad);
/** Prints highscore screen */
void highscores_screen(N5110 &lcd, Gamepad &pad);
/** Prints settings screen */
void settings_screen(N5110 &lcd, Gamepad &pad);
/** Changes screen to menu choice and returns start game message
* @returns a bool: true to start game, false to stay in menu
*/
bool menu_change(N5110 &lcd, Gamepad &pad);
/** Updates cursor and returns menu choice*/
void cursor_select(Gamepad &pad, N5110 &lcd);
/** Returns frame rate
* @returns frame rate chosen in settings
*/
int get_frame_rate();
private:
void drawSettings(N5110 &lcd, Gamepad &pad);
void drawSettingsBars(N5110 &lcd);
void move_cursor(N5110 &lcd);
void drawCursor(N5110 &lcd);
int _cursor_pos;
float _pot;
float _contrast;
float _brightness;
int _frame_rate;
Direction _joy_direction;
};
#endif