James Cummins / Mbed 2 deprecated el17jnc

Dependencies:   mbed

main.cpp

Committer:
JamesCummins
Date:
2019-04-06
Revision:
5:7e8f5fad7b6b
Parent:
4:2f01b85e57f9
Child:
6:952ac12c7f00

File content as of revision 5:7e8f5fad7b6b:

/*
ELEC2645 Embedded Systems Project
School of Electronic & Electrical Engineering
University of Leeds
Name: James Nathan Cummins
Username: el17jnc
Student ID Number: 201096364
Date: 22/03/19
*/

#include "Gamepad.h"
#include "mbed.h"
#include "N5110.h"

Gamepad device();
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
void startmenu();

int main(){
    /*device.init();*/
    lcd.init();
    wait(1);
    startmenu();
}
    
void startmenu() {
    lcd.clear();
    char gamename[] = {'L', 'A', 'B', 'Y', 'R', 'I', 'N', 'T', 'H', ' ', ' ', '\0'};
    int i = 0;
    for(int a = 0; a < 35; a++){
        lcd.clear();
        lcd.drawCircle(24+2*a, 21, 3, FILL_BLACK);
        for (i = 0; i < a/3; i++) {
            lcd.printChar(gamename[i], 15+i*6, 2);
            lcd.refresh();
            }
    wait(0.05);
    }
    lcd.printString("Press start", 9, 4);
    lcd.printString("to play >", 15, 5);
    
}