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:
- shahidsajid
- Date:
- 2019-05-08
- Revision:
- 31:eefa1d23a843
- Parent:
- 24:23fd6b451db7
- Child:
- 33:9d34ef219fff
File content as of revision 31:eefa1d23a843:
/*
ELEC2645 Embedded Systems Project
School of Electronic & Electrical Engineering
University of Leeds
Name: Shahid Zubin Sajid
Username: el17szs
Student ID Number: 201197609
Date: 21/03/2019
*/
#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include "Ball.h"
#include "Bat.h"
#include "Cricket.h"
#define BALL_SIZE 2
#define BAT_HEIGHT 3
#define BAT_WIDTH 6
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Gamepad mainpad;
Cricket cricket;
void init();
void welcome();
void draw();
void ball_test();
int main(){
int fps=14;
init();
//welcome();
//draw();
cricket.intro(lcd);
while(1){
cricket.game(lcd,mainpad);
draw();
wait(1.0f/fps);
}
}
void init(){
lcd.init();
mainpad.init();
cricket.init(BALL_SIZE,BAT_WIDTH,BAT_HEIGHT);
}
void draw(){
lcd.clear();
cricket.draw(lcd);
lcd.refresh();
}