motorInitPulseWidth con 1000 'initialization pulse-width for the Castle Creations Phoenix-80 brushless motor controller minMotorPulseWidth con 2000 'minimum pulsewidth that the escro will respond to, setting the motor to minimum power maxMotorPulseWidth con 3000 'maximum pulsewidth that the escro will respond to, setting the motor to maximum power motorPulseWidth var WORD Motor con p3 motorPower var word switchVar var BYTE Initialize: 'initializes the escro on the motor so the motor will start working 'without this the escro won't process any other pulsewidth values 'thus the motor will never start spinning without this initialization PulsOut Motor, motorInitPulseWidth switchVar = 0 motorPower = 1000 main: Low Motor PulsOut Motor, motorPower 'increase the pulsewidth gradually as the program runs until reached max power, then start over if motorPower > maxMotorPulseWidth Then motorPower = minMotorPulseWidth else if(switchVar = 10) then motorPower = motorPower + 10 switchVar = 0 else switchVar = switchVar + 1 endif endif 'for debuggine SEROUT s_out, I4800, ["Pulsewidth: ", DEC motorPower, 10, 13] pause 20 'pause 20 milliseconds before re-sending goto main