Motor speed controlled by potmeter
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
main.cpp
- Committer:
- s1932896
- Date:
- 2019-09-19
- Revision:
- 5:78a5043b6658
- Parent:
- 1:b862262a9d14
- Child:
- 6:211eab80755c
- Child:
- 9:c9cff697f4ab
File content as of revision 5:78a5043b6658:
#include "mbed.h" //#include "HIDScope.h" //#include "QEI.h" #include "MODSERIAL.h" //#include "BiQuad.h" #include "FastPWM.h" PwmOut led(D3); AnalogIn pot1(A1); AnalogIn but1(A2); AnalogIn but2(A3); MODSERIAL pc(USBTX, USBRX); int main() { pc.baud(115200); pc.printf("\r\nStarting...\r\n\r\n"); while (true) { pc.printf("%f",pot1.read()); led.write(pot1.read()); wait_ms(100); } }