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.
main.cpp@2:ee6a6bcbce87, 2020-03-11 (annotated)
- Committer:
- thestudent
- Date:
- Wed Mar 11 15:31:56 2020 +0000
- Revision:
- 2:ee6a6bcbce87
- Parent:
- 1:664a272ab028
- Child:
- 3:12b2bc47a0df
Drawing and getting the cannon moving
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
eencae | 0:b7f1f47bb26a | 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" |
eencae | 0:b7f1f47bb26a | 18 | |
eencae | 0:b7f1f47bb26a | 19 | |
eencae | 0:b7f1f47bb26a | 20 | // objects |
eencae | 0:b7f1f47bb26a | 21 | Gamepad pad; |
eencae | 0:b7f1f47bb26a | 22 | N5110 lcd; |
thestudent | 2:ee6a6bcbce87 | 23 | Objects objects; |
thestudent | 2:ee6a6bcbce87 | 24 | |
thestudent | 2:ee6a6bcbce87 | 25 | //functions |
thestudent | 2:ee6a6bcbce87 | 26 | void initialise(); |
eencae | 0:b7f1f47bb26a | 27 | |
eencae | 0:b7f1f47bb26a | 28 | int main() |
eencae | 0:b7f1f47bb26a | 29 | { |
thestudent | 2:ee6a6bcbce87 | 30 | initialise(); |
thestudent | 2:ee6a6bcbce87 | 31 | |
thestudent | 2:ee6a6bcbce87 | 32 | while(1){ |
thestudent | 2:ee6a6bcbce87 | 33 | lcd.clear(); |
thestudent | 2:ee6a6bcbce87 | 34 | objects.draw_base(lcd); |
thestudent | 2:ee6a6bcbce87 | 35 | objects.draw_cannon(lcd); |
thestudent | 2:ee6a6bcbce87 | 36 | objects.cannon_position(pad); |
thestudent | 2:ee6a6bcbce87 | 37 | lcd.refresh(); |
thestudent | 2:ee6a6bcbce87 | 38 | wait(0.005); |
thestudent | 2:ee6a6bcbce87 | 39 | |
thestudent | 2:ee6a6bcbce87 | 40 | } |
thestudent | 2:ee6a6bcbce87 | 41 | } |
thestudent | 2:ee6a6bcbce87 | 42 | |
thestudent | 2:ee6a6bcbce87 | 43 | void initialise(){ |
thestudent | 2:ee6a6bcbce87 | 44 | pad.init();//initialises the gamepad |
thestudent | 2:ee6a6bcbce87 | 45 | lcd.init();//initialises the N5100 screen |
eencae | 0:b7f1f47bb26a | 46 | |
eencae | 0:b7f1f47bb26a | 47 | } |
eencae | 0:b7f1f47bb26a | 48 |