Micromouse / Mbed 2 deprecated Main-codetest

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
x58alex41
Date:
Fri Apr 06 00:06:51 2018 +0000
Parent:
11:fb806a599444
Commit message:
started gyro

Changed in this revision

Gyro.cpp Show annotated file Show diff for this revision Revisions of this file
Gyro.h Show annotated file Show diff for this revision Revisions of this file
flood_fill.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Gyro.cpp	Thu Apr 05 23:37:51 2018 +0000
+++ b/Gyro.cpp	Fri Apr 06 00:06:51 2018 +0000
@@ -1,4 +1,8 @@
-//
 
 #include "Gyro.h"
 
+int gyro::angle()
+{
+    
+
+}
\ No newline at end of file
--- a/Gyro.h	Thu Apr 05 23:37:51 2018 +0000
+++ b/Gyro.h	Fri Apr 06 00:06:51 2018 +0000
@@ -1,9 +1,17 @@
 #ifndef _Gyro_
-#define _Gyro_ 
+#define _Gyro_
 
 #include "globals.h"
 
 AnalogIn Gyro (PC_4);
 
-
+class gyro
+{
+public:
+    gyro();
+    int angle();
+private:
+    int m_angle;
+    int m_zero;
+};
 #endif
\ No newline at end of file
--- a/flood_fill.cpp	Thu Apr 05 23:37:51 2018 +0000
+++ b/flood_fill.cpp	Fri Apr 06 00:06:51 2018 +0000
@@ -5,18 +5,18 @@
     for(int i=0; i<7; i++) {
         for(int j=0; j<7; j++) {
             m_cells[i][j].dist=14-i-j;
-            m_cells[i][16-j].dist=14-i-j;
-            m_cells[16-i][j].dist=14-i-j;
-            m_cells[16-i][16-j].dist=14-i-j;
+            m_cells[i][15-j].dist=14-i-j;
+            m_cells[15-i][j].dist=14-i-j;
+            m_cells[15-i][16-j].dist=14-i-j;
         }
     }
     for(int i=0; i< 16; i++) {
-        m_cells[i][0].left_clear=false;
-        m_cells[i][15].right_clear=false;
+        m_cells[i][0].down_clear=false;
+        m_cells[i][15].up_clear=false;
     }
     for(int i=0; i< 16; i++) {
-        m_cells[0][i].down_clear=false;
-        m_cells[15][i].up_clear=false;
+        m_cells[0][i].left_clear=false;
+        m_cells[15][i].right_clear=false;
     }
 
 }