statemachine
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
main.cpp
- Committer:
- boydmartherus
- Date:
- 2019-09-20
- Revision:
- 6:c2608dedfd70
- Parent:
- 5:9ebcbd39ec3f
- Child:
- 7:d5e07647dfea
- Child:
- 8:b2e57b815f68
File content as of revision 6:c2608dedfd70:
#include "mbed.h" #include "MODSERIAL.h"; #include "FastPWM.h" ; #include "QEI.h"; AnalogIn pot(PTB2); Serial pc(USBTX,USBRX); FastPWM motor(D5); // Encoding int pulses = 131; QEI wheel (D13,D12,NC, pulses); int main(){ while(1){ wait(0.1); pc.printf("Pulses is: %i\n", wheel.getPulses()); printf("motor relative speed is (%f)\n\r",pot.read()); motor.write(pot); } }