![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
br g5
Dependencies: mbed QEI HIDScope Motor biquadFilter MODSERIAL FastPWM
main.cpp
- Committer:
- boydmartherus
- Date:
- 2019-09-20
- Revision:
- 10:9101c7a4f219
- Parent:
- 9:cdcf30051100
- Child:
- 11:5171ac607099
File content as of revision 10:9101c7a4f219:
#include "mbed.h" #include "MODSERIAL.h"; #include "FastPWM.h" ; #include "QEI.h" ; Serial pc(USBTX,USBRX); InterruptIn button1(PTC2); InterruptIn button2(PTC3); InterruptIn button3(PTA4); InterruptIn button4(PTC6); AnalogIn pot(PTB2); FastPWM motor(D5); FastPWM led(PTA1); //DigitalOut richting(D4); //int direction = 0; //void flip() { // direction = !direction; //} //DigitalOut richting(D4); int pulses = 131; QEI wheel (D13,D12,NC,pulses); int main() { printf("Controll with dial\n"); while(true) { wait(0.1); printf("motor speeed is (%f)\n\r",pot.read()); wait(0.1); led.write(pot); motor.write(pot); wait(0.1); printf("pulse number is (%i)\n\r",wheel.getPulses()); } }