Edward Stott
/
ES_CW2_Starter
Starter code for brushless motor controller
Revision 12:6ad981ef8cc9, committed 2020-02-23
- Comitter:
- estott
- Date:
- Sun Feb 23 14:55:44 2020 +0000
- Parent:
- 11:5ff18183764a
- Commit message:
- Removed some statements used for debugging
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 5ff18183764a -r 6ad981ef8cc9 main.cpp --- a/main.cpp Wed Feb 19 21:01:00 2020 +0000 +++ b/main.cpp Sun Feb 23 14:55:44 2020 +0000 @@ -126,15 +126,12 @@ pc.printf("Rotor origin: %x\n\r",orState); //orState is subtracted from future rotor state inputs to align rotor and motor states - MotorPWM.pulsewidth_us(PWM_PRD/2); //Poll the rotor state and set the motor outputs accordingly to spin the motor while (1) { intState = readRotorState(); if (intState != intStateOld) { motorOut((intState-orState+lead+6)%6); //+6 to make sure the remainder is positive - if (intState == 4 && intStateOld == 3) TP1 = !TP1; intStateOld = intState; - pc.printf("%d\n\r",intState); } } }