
Final Commit
Dependencies: mbed
main.cpp@5:27fcb9b36e7e, 2018-03-13 (annotated)
- Committer:
- JRM1986
- Date:
- Tue Mar 13 09:42:49 2018 +0000
- Revision:
- 5:27fcb9b36e7e
- Parent:
- 4:a9634970d33e
- Child:
- 6:f3f508cea1c4
Basic functions and methods done for Food class.; Testing suggests that pixel is not being randomly set, or within range of 48*84 display.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JRM1986 | 3:50f01159c61d | 1 | #include "mbed.h" |
JRM1986 | 3:50f01159c61d | 2 | #include "FXOS8700CQ.h" |
JRM1986 | 3:50f01159c61d | 3 | #include "Gamepad.h" |
JRM1986 | 3:50f01159c61d | 4 | #include "N5110.h" |
JRM1986 | 5:27fcb9b36e7e | 5 | #include "Testing.h" |
JRM1986 | 0:53ee0f689634 | 6 | /* |
JRM1986 | 0:53ee0f689634 | 7 | ELEC2645 Embedded Systems Project |
JRM1986 | 0:53ee0f689634 | 8 | School |
JRM1986 | 0:53ee0f689634 | 9 | of Electronic & Electrical Engineering |
JRM1986 | 0:53ee0f689634 | 10 | University of Leeds |
JRM1986 | 0:53ee0f689634 | 11 | Name: Joshua Robert Marshall |
JRM1986 | 0:53ee0f689634 | 12 | Username: ll13jrm |
JRM1986 | 0:53ee0f689634 | 13 | Student ID Number: 200764543 |
JRM1986 | 0:53ee0f689634 | 14 | Date: 28/02/2018 |
JRM1986 | 3:50f01159c61d | 15 | */ |
JRM1986 | 3:50f01159c61d | 16 | |
JRM1986 | 5:27fcb9b36e7e | 17 | Testing test; |
JRM1986 | 3:50f01159c61d | 18 | |
JRM1986 | 3:50f01159c61d | 19 | int main() { |
JRM1986 | 3:50f01159c61d | 20 | |
JRM1986 | 5:27fcb9b36e7e | 21 | // ----- Testing Program ----- |
JRM1986 | 3:50f01159c61d | 22 | while(1){ |
JRM1986 | 3:50f01159c61d | 23 | |
JRM1986 | 5:27fcb9b36e7e | 24 | if(test.food_test_position()) { |
JRM1986 | 5:27fcb9b36e7e | 25 | |
JRM1986 | 5:27fcb9b36e7e | 26 | printf("Passed position test \n"); |
JRM1986 | 5:27fcb9b36e7e | 27 | |
JRM1986 | 5:27fcb9b36e7e | 28 | } |
JRM1986 | 5:27fcb9b36e7e | 29 | |
JRM1986 | 5:27fcb9b36e7e | 30 | else { |
JRM1986 | 5:27fcb9b36e7e | 31 | |
JRM1986 | 5:27fcb9b36e7e | 32 | printf("Failed position test \n"); |
JRM1986 | 5:27fcb9b36e7e | 33 | |
JRM1986 | 5:27fcb9b36e7e | 34 | } |
JRM1986 | 5:27fcb9b36e7e | 35 | |
JRM1986 | 5:27fcb9b36e7e | 36 | if(test.food_test_range()) { |
JRM1986 | 5:27fcb9b36e7e | 37 | |
JRM1986 | 5:27fcb9b36e7e | 38 | printf("Passed Range Test \n"); |
JRM1986 | 5:27fcb9b36e7e | 39 | |
JRM1986 | 5:27fcb9b36e7e | 40 | } |
JRM1986 | 5:27fcb9b36e7e | 41 | |
JRM1986 | 5:27fcb9b36e7e | 42 | else { |
JRM1986 | 5:27fcb9b36e7e | 43 | |
JRM1986 | 5:27fcb9b36e7e | 44 | printf("Failed Range Test \n"); |
JRM1986 | 5:27fcb9b36e7e | 45 | |
JRM1986 | 5:27fcb9b36e7e | 46 | } |
JRM1986 | 4:a9634970d33e | 47 | |
JRM1986 | 5:27fcb9b36e7e | 48 | wait(1.0); |
JRM1986 | 3:50f01159c61d | 49 | |
JRM1986 | 3:50f01159c61d | 50 | |
JRM1986 | 3:50f01159c61d | 51 | } |
JRM1986 | 3:50f01159c61d | 52 | |
JRM1986 | 3:50f01159c61d | 53 | } |