James Heavey / Mbed 2 deprecated 3875_DISSERTATION

Dependencies:   mbed 3875_Individualproject

Revision:
20:5cf6a378801d
Parent:
18:991658b628fc
Child:
21:54ea75f7984f
--- a/main/main.h	Tue Mar 17 21:08:10 2020 +0000
+++ b/main/main.h	Tue Mar 24 14:20:32 2020 +0000
@@ -3,7 +3,14 @@
 
 #include "m3pi.h"
 #include "mbed.h"
-#include "QTRSensors.h"
+
+// Constants
+#define A 0.5         // 20
+#define B 1/10000     // 10000
+#define C 1.5         // 2/3
+
+#define SENS_THRESH 500    // >500 = black
+#define TURN_SPEED 0.2
 
 // API 
 extern m3pi robot;
@@ -29,9 +36,39 @@
 extern DigitalInOut QTRA; //connected to digital P26
 extern DigitalInOut QTRB; //connected to digital P25
 
-// Globals
+// Timers
+Timer t_L;
+Timer t_R;
 
 // Prototypes
+void read_encoders();
+void init();
+void calibrate();
+void follow_line();
+bool junction_detect();
+char junction_logic();
+void turn_select( char turn );
+void left();
+void right();
+void back();
+void goal();
+void simplify();
+void invert_path();
+void non_looped();
+void looped();
 
+// Global Variables
+char path[100];
+char inv_path[100];
+int path_length = 0;
+unsigned int *sensor;
+float speed;
+float proportional = 0.0;
+float prev_proportional = 0.0;
+float integral = 0.0;
+float derivative = 0.0;
+int encoder[2];
+int dist_est_1 = 0;
+int dist_est_2 = 0;
 
 #endif
\ No newline at end of file