Step 1 : Declare the variables in the “Declare Variable” section.
Example:
=============in Declare Variable section=============
PWM1 VAR byte 'define variable for use in Serout command
PWM2 VAR byte 'define variable for use in Serout command
Step 2 : Add the following to the main Program:
=============in MAIN PROGRAM section ================
PWM1 = (((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000)
PWM2 = (((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000)
Step 3 : Finally place PWM1 And PWM2 in the Serout command respectively.
Serout USERCPU, OUTBAUD, [255,255, PWM1, relayA, PWM2, relayB, p3_y, p4_y, p1_x, p2_x, p3_x, p4_x, p1_wheel, p2_wheel, p3_wheel, p4_wheel, 127,127,127,127]
Additional Information:
y-axis controls speed
x axis turns
PWM1 - Left Motor
PWM2 - Right Motor