Control of motors
Dependencies: MODSERIAL QEI mbed
Diff: main.cpp
- Revision:
- 1:941f4059c0de
- Parent:
- 0:2d34e3627dae
- Child:
- 2:e4f92118a829
--- a/main.cpp Fri Sep 28 09:08:18 2018 +0000 +++ b/main.cpp Fri Sep 28 09:20:44 2018 +0000 @@ -3,9 +3,9 @@ #include "math.h" DigitalOut DirectionPin1(D4); -DigitalOut DirectionPin2(D6); +DigitalOut DirectionPin2(D7); PwmOut PwmPin1(D5); -PwmOut PwmPin2(D7); +PwmOut PwmPin2(D6); AnalogIn potmeter1(A0); AnalogIn potmeter2(A1); Ticker TickerReadPots; @@ -27,6 +27,7 @@ int main() { PwmPin1.period_us(60); // 16.66667 kHz (default period is too slow!) + TickerReadPots.attach(&ReadPots,0.05); // every 50 milli seconds. while (true)