TomYumBoys / Mbed 2 deprecated MM2017

Dependencies:   mbed

Revision:
8:4a32fc9ee939
Parent:
7:7215adbae3da
Child:
12:6f48afe41cd9
--- a/Control/drivecontrol.cpp	Sun May 14 19:57:34 2017 +0000
+++ b/Control/drivecontrol.cpp	Wed May 17 00:07:32 2017 +0000
@@ -4,10 +4,14 @@
 #include "left_motor.h"
 #include "right_motor.h"
 #include "pin_assignment.h"
+//#include "encoder.h"
 
 IRSensor leftIR(PA_8, PC_5);
 IRSensor rightIR(PB_0, PA_4);
 
+//Encoder rightEncoder(PA_1, PA_0);
+//Encoder leftEncoder(PC_9, PC_8);
+
 // Define states for debugging the mouse hardware
 const int DRIVE = 0, TURN = 2, STOP = 4;
 const int TURN_LEFT = 0, TURN_RIGHT = 1, TURN_AROUND = 2;
@@ -114,6 +118,11 @@
     return DRIVE;
 }
 
+void DriveControl::getEncoder(){
+    pc.printf("LeftEncoder Reading %d", leftEncoder.getEncoderDistance(1));
+    pc.printf("RightEncoder Reading %d\n\r", rightEncoder.getEncoderDistance(0));
+}
+
 void DriveControl::turn_right() {
     // TODO: Add PID Control
     pid_controller::turn(TURN_RIGHT);