Starter code for brushless motor controller

Files at this revision

API Documentation at this revision

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
--- 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);
         }
     }
 }