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 N5110 ShiftReg PinDetect
MainMenu.cpp
- Committer:
- Siriagus
- Date:
- 2015-04-28
- Revision:
- 1:0cfe2255092a
File content as of revision 1:0cfe2255092a:
#include "MainMenu.h"
MainMenu::MainMenu(N5110 *lcd, PinName buttonA, PinName buttonB, PinName buttonC)
{
this->lcd = lcd;
btnA = new InterruptIn(buttonA);
btnB = new InterruptIn(buttonB);
btnC = new InterruptIn(buttonC);
choice = 0;
}
MainMenu::~MainMenu()
{
delete btnA;
delete btnB;
delete btnC;
}
void MainMenu::nextChoiceISR()
{
choice %= (choice + 1);
}
void MainMenu::run()
{
// Update
//Nothing is done by interrupts
// Render
lcd->printString("Play", 0, 1);
lcd->printString("Highscores", 0, 2);
lcd->printString("Controls", 0, 3);
wait(10);
// Todo: Insert Sleep();
}