Luccas Eagles
/
CONTROL_MOTOR_MELODY
added melody to old motorcontol
Diff: main.cpp
- Revision:
- 12:6ad981ef8cc9
- Parent:
- 11:5ff18183764a
- Child:
- 13:58ada64bb664
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); } } }