Scaled IR readings by 10^5 so also changed thresholds. Implemented and tested LED multiplexing Working on a new turning scheme involving IR readings
Dependencies: QEI RemoteIR mbed
Fork of encoder_v2 by
main.cpp
- Committer:
- kensterino
- Date:
- 2017-12-09
- Revision:
- 18:14bf07a27998
- Parent:
- 10:707e542688dc
File content as of revision 18:14bf07a27998:
/* #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); QEI encoder_Left(PA_1, PC_4, NC, 360, QEI::X4_ENCODING); //forward increases pulses PwmOut m_Right_B(PC_7); PwmOut m_Right_F(PB_10); PwmOut m_Left_F(PA_7); 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) Reset the encoder. int getCurrentState (void) Read the state of the encoder. int getPulses (void) Read the number of pulses recorded by the encoder. int getRevolutions (void) Read the number of revolutions recorded by the encoder on the index channel. */ /* int main() { while(1) { LS_IRE.write(1); float value = LS_IRR.read(); printf("IR Led: %f", value); wait(100); LS_IRE.write(0); } } */