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.
Menu/Menu.cpp
- Committer:
- Andrew_M
- Date:
- 2018-05-06
- Revision:
- 9:fe86ddbf7799
- Parent:
- 8:9d01fd4a63ad
- Child:
- 10:279d3775d52c
File content as of revision 9:fe86ddbf7799:
#include "Menu.h" // nothing doing in the constructor and destructor Menu::Menu() { } Menu::~Menu() { } void Menu::init() { _start = false; _selection = 1; } void Menu::update() { if (_d == N && _selection > 1) { //checks the menu arrow location _selection -= 1; } else if (_d == S && _selection < 3) { _selection += 1; } } void Menu::read_input(Gamepad &pad) { _d = pad.get_direction(); } void Menu::draw(N5110 &lcd) { lcd.printString(" Start",0,1); lcd.printString(" Level Select",0,2); lcd.printString(" Difficulty",0,3); lcd.printString(" >",0,_selection); } bool Menu::started() { return _start; }