pwm 13-15

while using the one joystick control code can drive_R and drive_L be used indvidualy like p1_y and p1_x in order to use pwm 13 & 15 indpendently

example: in the one joy stick control code it combides p1_y and p1_x to drive_R and drive_L

drive_r = pwm 13and pwm 15
drive_L = pwm 16 and pwm 14
my motors a on pwm 15 and pwm 13:confused:

i want to use pwms 13And 15 for drive motor and no pwms 1and 2

If I understand your question correctly, yes and its easy to do, there is a simple trick to it.

If you drive the left motor with P1_y and the right motor with P1_x

then all you need to do is turn your joystick 45° on the control panel. (the whole joystick unit, so instead of being oriented like a square, its looks like a diamond)

then, what use to be the upper right corner of the joystick travel will become straight ahead (both motors on full) and what use to be the lower left corner becomes full astern.

the only drawback is the handle on the joystick is rotated, so the buttons are awkward to use.

If I understand you correctly, you want the drive_L variable to be used for both PWM16 and PWM14, and the drive_R to be used for PWM13 and PWM15.

One way you could do this is to place each of those two variables (drive_L and drive_R) into the positions for each of the two PWM outputs in the SEROUT command.

'  Serout USERCPU, OUTBAUD, [255,255,(PWM1),relayA,(PWM2),relayB,(PWM3),(PWM4),(PWM5),(PWM6),(PWM7),(PWM8),(PWM9),(PWM10),(PWM11),(PWM12),(PWM13),(PWM14),(PWM15),(PWM16),(OSC)]

   SEROUT USERCPU, OUTBAUD, [255,255,127,relayA,127,relayB,127,127,127,127,127,127,127,127,127,127,drive_R,drive_L,drive_R,drive_L]

The first line is the example SEROUT that IFI provides in the default 2003 EduRC code, so what I did was place the drive_L and drive_R variables in the string of output bytes where the system will be expecting PWM[13-16]. I set all other PWM values to 127, but you can replace these with whatever you’d like.

I hope this helps. If I misunderstood the question, I blame the fact that I just woke up…