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-06
- Revision:
- 13:681192091568
- Parent:
- 12:7f7fadb5c106
- Child:
- 14:08ac9aaa34c3
File content as of revision 13:681192091568:
#ifndef MENU_H
#define MENU_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "SDFileSystem.h"
#include <algorithm>
/** 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 */
bool menu_loop(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
void highscores_loop(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
/** Returns frame rate
* @returns frame rate chosen in settings
*/
int get_frame_rate();
private:
void read_input(Gamepad &pad);
void sd_read(SDFileSystem &sd);
bool menu_change(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
bool start_loop(Gamepad &pad, N5110 &lcd);
void settings_loop(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
void drawSettings(N5110 &lcd);
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;
int *_highscores_array;
Direction _joy_direction;
};
#endif