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: MMA8452 N5110 PowerControl beep mbed
Menu.h
- Committer:
- stevenle93
- Date:
- 2015-05-02
- Revision:
- 2:57d1ed1f0ad3
- Child:
- 3:1974db5993ef
File content as of revision 2:57d1ed1f0ad3:
/**
@file Menu.h
@brief This header file contains the project menu and using FSM
*/
#ifndef MENU_H
#define MENU_H
#include "mbed.h"
#include "MMA8452.h"
#include "N5110.h"
#include "Game.h"
InterruptIn ButtonA(p16);
InterruptIn ButtonB(p15);
InterruptIn ButtonD(p24);
InterruptIn ButtonU(p23);
int BuAFlag = 0;
int BuBFlag = 0;
int BuDFlag = 0;
int BuUFlag = 0;
int state = 0;
void BuAPress()
{
BuAFlag = 1; //Set flag for button A
}
void BuBPress()
{
BuBFlag = 1; //Set flag for button B
}
void BuDPress()
{
BuDFlag = 1; //Set flag for button Down
}
void BuUPress()
{
BuUFlag = 1; //Set flag for button Up
}
class Menu
{
public:
/**
* @
*/
void submain1();
void submain2();
void highscore();
void startgame();
void gamescreen();
void subyourscore1();
void subyourscore2();
};
void Menu::submain1()
{
lcd.printString("Main menu",16,1);
lcd.printString("Play",31,3);
lcd.printString("Score",31,4);
lcd.drawCircle(23,27,2,1);
};
void Menu::submain2()
{
lcd.printString("Main menu",16,1);
lcd.printString("Play",31,3);
lcd.printString("Score",31,4);
lcd.drawCircle(23,35,2,1);
};
void Menu::highscore(){
lcd.printString("High Score",13,1);
};
#endif