ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jgb

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
el18jgb
Date:
Sun May 24 11:24:57 2020 +0000
Parent:
22:7406068f6c59
Commit message:
Final Submission. I have read and agreed with Statement of Academic Integrity.

Changed in this revision

Aim/Aim.cpp Show annotated file Show diff for this revision Revisions of this file
Heston/Heston.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
menu/Menu.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Aim/Aim.cpp	Sun May 24 10:28:20 2020 +0000
+++ b/Aim/Aim.cpp	Sun May 24 11:24:57 2020 +0000
@@ -106,10 +106,10 @@
 void Aim::acc_control(FXOS8700CQ &acc)
 {
     float roll = acc.get_roll_angle();
-    _x = _x + roll;
+    _x = _x + (roll/2);
     //printf("roll =  %f\n", roll);
     float pitch = acc.get_pitch_angle();
-    _y = _y - pitch;
+    _y = _y - (pitch/2);
     //printf("pitch =  %f\n", pitch);
     
     // check the x origin to ensure that the paddle doesn't go off screen
--- a/Heston/Heston.cpp	Sun May 24 10:28:20 2020 +0000
+++ b/Heston/Heston.cpp	Sun May 24 11:24:57 2020 +0000
@@ -7,9 +7,9 @@
     {0,0,1,1,1,1,1,1,1,0,0},//any resemblance to the celebrity chef is purely coincidental...honestly
     {0,1,0,0,0,0,0,0,0,1,0},//other celebrity chefs are available
     {1,1,1,1,1,1,1,1,1,1,1},
-    {1,0,1,0,1,0,1,0,1,0,1},
-    {1,0,1,1,1,0,1,1,1,0,1},
-    {0,1,0,0,0,1,0,0,0,1,0},
+    {1,0,1,0,1,0,1,0,1,0,1},//unfortunetly i got the lockdown shaved head
+    {1,0,1,1,1,0,1,1,1,0,1},//this is a referance to a mate saying i look like
+    {0,1,0,0,0,1,0,0,0,1,0},//heston with my specs on
     {0,1,0,0,0,0,0,0,0,1,0},
     {0,1,0,1,1,1,1,1,0,1,0},
     {0,1,0,0,1,1,1,0,0,1,0},
--- a/main.cpp	Sun May 24 10:28:20 2020 +0000
+++ b/main.cpp	Sun May 24 11:24:57 2020 +0000
@@ -39,18 +39,11 @@
 Highscore hs;
 SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd");
 
-// flag - must be volatile as changes within ISR
-// g_ prefix makes it easier to distinguish it as global
-volatile int g_timer_flag = 0;
-
-// function prototypes
-void timer_isr();
-
 
 void init();
 void render();
 void play(Gamepad &pad, N5110 &lcd, FXOS8700CQ &acc);
-//void read_input(Gamepad &pad);
+
 
 int main()
 {
@@ -117,9 +110,9 @@
     while (1) {
         //read_input(pad);
         int fire = 0;
-        if (A_timer <= 0){
+        if (A_timer <= 0){//shot timer to prevent spam
             fire = 0;
-            if (pad.A_held()){
+            if (pad.A_held()){//a held worked better than pressed
                 fire = 1;
                 A_timer = 6;
                 
--- a/menu/Menu.cpp	Sun May 24 10:28:20 2020 +0000
+++ b/menu/Menu.cpp	Sun May 24 11:24:57 2020 +0000
@@ -77,7 +77,7 @@
         option = 3;
     }
     
-    if (option == 0){
+    if (option == 0){//despite being a 'mode' this means an option is always chosen
         option = 1;
     }
     
@@ -99,7 +99,7 @@
 
 void Menu::instructions(N5110 &lcd, Gamepad &pad)
 {
-    while ( pad.B_held() == false) {
+    while ( pad.B_held() == false) {//b held works better than pressed
         lcd.clear();
             
         lcd.printString(" Instructions ",0,0);  
@@ -121,7 +121,7 @@
 void Menu::highs_screen(N5110 &lcd, Gamepad &pad, Highscore &hs, SDFileSystem &sd)
 {
 
-    while ( pad.B_held() == false) {
+    while ( pad.B_held() == false) {//b held works better than pressed
         lcd.clear();
         
         int value = hs.geths(sd);
@@ -129,8 +129,8 @@
         lcd.printString("   Highscore  ",0,0);
         
         char buffer1[14];
-        sprintf(buffer1,"%2d",value);
-        lcd.printString(buffer1,34,3);  // font is 8 wide, so leave 4 pixel gape from middle assuming two digits
+        sprintf(buffer1,"%2d",value);//prints the stored score
+        lcd.printString(buffer1,34,3);  
 
         lcd.printString("return press B",0,5);