Dependencies:   QEI RemoteIR mbed

Fork of encoder_v2 by Joshua Cheung

Revision:
7:e10dc3cb9212
Parent:
2:aa961ba3199e
Child:
10:707e542688dc
--- a/main.cpp	Sat Nov 11 03:05:20 2017 +0000
+++ b/main.cpp	Wed Nov 29 02:48:57 2017 +0000
@@ -1,5 +1,7 @@
 /*
 #include "mbed.h"
+Serial pc (PA_2, PA_3);
+/*
 #include "QEI.h"
 Serial pc (PA_2, PA_3); //serial comm enabled on pins pa_2 and pa_3
 QEI encoder_Right(PB_3, PA_15, NC, 360, QEI::X4_ENCODING);
@@ -10,6 +12,18 @@
 PwmOut m_Left_B(PB_6); 
 */
 
+/*//IRR = IR Reciver
+AnalogIn RS_IRR(PA_0); //Right Side 
+AnalogIn RF_IRR(PA_4); //Right Front
+AnalogIn LF_IRR(PC_1); //Left Front
+AnalogIn LS_IRR(PC_0); //Left Side
+
+//IRE = IR Emitter
+DigitalOut RS_IRE(PC_10); //Right Side
+DigitalOut RF_IRE(PC_11); //Right Front
+DigitalOut LF_IRE(PB_0); //Left Front
+DigitalOut LS_IRE(PB_7); //Left Side 
+
 //QEI functions
 /*
 void    reset (void)
@@ -21,20 +35,17 @@
 int     getRevolutions (void)
     Read the number of revolutions recorded by the encoder on the index channel.
 */
+
 /*
 int main()
 {
-    m_Right_F.write(0.5);
-    //m_Left_F.write(.25);
-    //m_Left_B.write(.25); 
-    while(1) {
-        wait(0.1);
-        
-        pc.printf("Pulses is: %i\n", encoder_Right.getPulses());
-        //pc.printf("Pulses is: %i\n", encoder_Left.getPulses());
+    while(1)
+    {
+        LS_IRE.write(1);
+        float value = LS_IRR.read();
+        printf("IR Led: %f", value);
+        wait(100);
+        LS_IRE.write(0);    
     }
-    
-    
-
 }
 */
\ No newline at end of file