![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Basic DC motor control test, rpm feedback by simple impulse signal, PID speed control.
Dependencies: FastPWM mbed FastIO MODSERIAL
Revision 2:70918f7f8451, committed 2018-03-23
- Comitter:
- dzoni
- Date:
- Fri Mar 23 12:31:38 2018 +0000
- Parent:
- 1:70c514e10598
- Child:
- 3:f6c30ada5370
- Commit message:
- Ready for integration test.
Changed in this revision
FastIO.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FastIO.lib Fri Mar 23 12:31:38 2018 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/Sissors/code/FastIO/#45b32f07e790
--- a/main.cpp Thu Mar 22 11:23:31 2018 +0000 +++ b/main.cpp Fri Mar 23 12:31:38 2018 +0000 @@ -1,22 +1,26 @@ #include "mbed.h" #include "FastPWM.h" +#include "FastIO.h" FastPWM mypwm(PWM_OUT); DigitalOut myled(LED1); +Serial pcLink(SERIAL_TX, SERIAL_RX); + int main() { mypwm.period_us(100); mypwm.write(0.0); - printf("pwm set to %.2f %%\n", mypwm.read() * 100); + pcLink.printf("pwm set to %.2f %%\n", mypwm.read() * 100); while(1) { int iCnt = 0; double dPwmDuty = 0.0; mypwm.write(dPwmDuty); + pcLink.printf("pwm set to %.2f %%\n", mypwm.read() * 100); if (10 < iCnt++) { iCnt = 0;