Arturs Kozlovskis / Mbed 2 deprecated ELEC2645_Project_el18ak

Dependencies:   mbed

Committer:
thestudent
Date:
Wed Apr 01 11:20:24 2020 +0000
Revision:
6:33bdb54c2c88
Parent:
5:8e3d6cbc8b02
Child:
7:82079de8bcd6
Creating a ball object and working on its movement across the screen. Got the ball going in a linear and parabolic way. For the functioning of the objects created a new class called functions. ;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thestudent 6:33bdb54c2c88 1 /*
eencae 0:b7f1f47bb26a 2 ELEC2645 Embedded Systems Project
eencae 0:b7f1f47bb26a 3 School of Electronic & Electrical Engineering
eencae 0:b7f1f47bb26a 4 University of Leeds
eencae 0:b7f1f47bb26a 5 2019/20
eencae 0:b7f1f47bb26a 6
thestudent 1:664a272ab028 7 Name:Arturs Kolovskis
thestudent 1:664a272ab028 8 Username:el18ak
thestudent 1:664a272ab028 9 Student ID Number: 201253737
thestudent 1:664a272ab028 10 Date:08.03.2020
eencae 0:b7f1f47bb26a 11 */
eencae 0:b7f1f47bb26a 12
eencae 0:b7f1f47bb26a 13 // includes
eencae 0:b7f1f47bb26a 14 #include "mbed.h"
eencae 0:b7f1f47bb26a 15 #include "Gamepad.h"
eencae 0:b7f1f47bb26a 16 #include "N5110.h"
thestudent 2:ee6a6bcbce87 17 #include "Objects.h"
thestudent 6:33bdb54c2c88 18 #include "Functions.h"
eencae 0:b7f1f47bb26a 19
eencae 0:b7f1f47bb26a 20
eencae 0:b7f1f47bb26a 21 // objects
eencae 0:b7f1f47bb26a 22 Gamepad pad;
eencae 0:b7f1f47bb26a 23 N5110 lcd;
thestudent 2:ee6a6bcbce87 24 Objects objects;
thestudent 6:33bdb54c2c88 25 Functions functions;
thestudent 2:ee6a6bcbce87 26
thestudent 2:ee6a6bcbce87 27 //functions
thestudent 2:ee6a6bcbce87 28 void initialise();
eencae 0:b7f1f47bb26a 29
eencae 0:b7f1f47bb26a 30 int main()
eencae 0:b7f1f47bb26a 31 {
thestudent 2:ee6a6bcbce87 32 initialise();
thestudent 2:ee6a6bcbce87 33
thestudent 6:33bdb54c2c88 34 while(1) {
thestudent 6:33bdb54c2c88 35 lcd.clear();
thestudent 6:33bdb54c2c88 36 objects.draw_base(lcd);
thestudent 6:33bdb54c2c88 37 objects.draw_cannon(lcd);
thestudent 6:33bdb54c2c88 38 objects.cannon_position(pad);
thestudent 6:33bdb54c2c88 39 objects.draw_shots(lcd);
thestudent 6:33bdb54c2c88 40 functions.ball_position(lcd, objects);
thestudent 6:33bdb54c2c88 41 lcd.refresh();
thestudent 6:33bdb54c2c88 42 wait(0.2);
thestudent 6:33bdb54c2c88 43
thestudent 2:ee6a6bcbce87 44 }
thestudent 2:ee6a6bcbce87 45 }
thestudent 2:ee6a6bcbce87 46
thestudent 6:33bdb54c2c88 47 void initialise()
thestudent 6:33bdb54c2c88 48 {
thestudent 2:ee6a6bcbce87 49 pad.init();//initialises the gamepad
thestudent 2:ee6a6bcbce87 50 lcd.init();//initialises the N5100 screen
thestudent 6:33bdb54c2c88 51
eencae 0:b7f1f47bb26a 52 }
eencae 0:b7f1f47bb26a 53