HI,

I am using an H-bridge L293. It seems that there are thre wires per motor for control. 1 for neg. , 1 for pos. and one for the HPWM. The PWM is put on the CCP1, while the other do not matter, as long as they are configured as 1 or 0 right ? well thats what I concluded from what I read. Is there any reason why this code would not work ? I am not getting any output

if right > left Then
temp =right-left
temp= temp * 254
temp= temp/right
PORTC.4=0
PORTC.5=1
HPWM 1,255-temp,1000
HPWM 2,255,1000

Else
temp =left-right
temp= temp * 254
temp= temp/left
PORTC.4=1
PORTC.5=0
HPWM 2,255-temp,1000
HPWM 1,255,1000
Endif