Hello, I am back with a robocar - PBP question. I wish I had the will power to really study this.

My robocars use HPWM to control the steering and to drive the Electronic Speed Control => DC motor for the wheels. I am trying to calibrate this command given different little cars.

Before the "main:" label I placed some code to make the wheels turn and steer. I discovered that HPWM rides through the PAUSE command sometimes and not other times. It depends on what code precedes the HPWM commands. Immediately below is a case that works. Below that is a case that does not. By not work, I mean the wheels just do not move.The only difference is the presence of the WHILE loop at the beginning.

The WHILE loop at the front checks the power status of the radio transmitter. If channel3 (PORTC.4) is pulsing the radio is receiving a signal from its transmitter. This works. It gives me an opportunity to put the car down on the floor.

What'z up here with HPWM and PAUSE???

-----THIS WORKS: Turn OFF the transmitter and the wheels move---------------

switchtoPIC = 2
WHILE switchtoPIC >= 2
COUNT channel3,65,switchtoPIC
HIGH portc.0
WEND

HPWM 1, Left, 50
HPWM 2, Forward, 50
pause 1000

HPWM 1, HalfLeft, 50
HPWM 2, HalfForward, 50
pause 1000

HPWM 1, Straight, 50
HPWM 2, brake, 50
pause 1000

main:

------THIS DOES NOT WORK. THE WHEELS DO NOT MOVE until main: ----------

HPWM 1, Left, 50
HPWM 2, Forward, 50
pause 1000

HPWM 1, HalfLeft, 50
HPWM 2, HalfForward, 50
pause 1000

HPWM 1, Straight, 50
HPWM 2, brake, 50
pause 1000

main: