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
main.cpp
- Committer:
- S_Tingle
- Date:
- 2019-04-11
- Revision:
- 3:72e0f4d267ed
- Parent:
- 2:2cc42dea101c
File content as of revision 3:72e0f4d267ed:
/*
ELEC2645 Embedded Systems Project
School of Electronic & Electrical Engineering
University of Leeds
Name: Spencer Tingle
Username: el17set
Student ID Number: 201147893
Date: 25/03/2019
*/
#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include "Game.h"
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Gamepad pad;
Game game;
void init();
void start();
void render();
int main(){
init();
lcd.setContrast(0.4);
lcd.setBrightness(0.5);
start();
render();
while (1) {
game.read_input(pad);
game.movement(pad);
render();
}
}
void init(){
lcd.init();
pad.init();
}
void render(){
lcd.clear();
game.drawSprite(lcd);
lcd.refresh();
wait(0.1);
}
void start(){
lcd.printString(" | Smiley Adventures | ",0,1);
lcd.printString(" Press Start to Begin ",0,4);
lcd.refresh();
}