XJEL2645 (19/20) / Mbed 2 deprecated el17my

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Menu Class Reference

Menu Class Reference

Menu Class. More...

#include <Menu.h>

Public Member Functions

 Menu ()
 Constructor.
 ~Menu ()
 Destructor.
void init ()
 Initialises the Menu.
void run_engine (N5110 &lcd, Gamepad &gamepad)
 Runs the menu and a state machine.

Detailed Description

Menu Class.

@1 build three page to choose @2 build a good welcome_page @3 connect with the gamepad and makesure the game is working

Date:
April 27th 2020
Author:
Yaomochu
#include "N5110.h"
#include "Gamepad.h"
#include "mbed.h"
#include "menu.h"

N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Gamepad gamepad;
menu _menu;

int main() {
  gamepad.init();
  _menu.init(); 
  lcd.init(); 
  lcd.normalMode();      
  lcd.setBrightness(0.5); 
  while(1) {
    
    // clear, refresh lcd and run the menu.
    lcd.clear();  
    _menu.run_engine(lcd, gamepad);   
    lcd.refresh();
    wait(0.01);  
  }     
}  

*

Definition at line 52 of file Menu.h.


Constructor & Destructor Documentation

Menu (  )

Constructor.

Non user specified.

Definition at line 39 of file Menu.cpp.

~Menu (  )

Destructor.

Non user specified.

Definition at line 41 of file Menu.cpp.


Member Function Documentation

void init (  )

Initialises the Menu.

Definition at line 43 of file Menu.cpp.

void run_engine ( N5110 lcd,
Gamepad gamepad 
)

Runs the menu and a state machine.

Parameters:
&lcdThe lcd object from the N5110 class
&gamepadThe gamepad object from Gamepad class

Definition at line 48 of file Menu.cpp.