guanerrr
- 10th April 2006, 17:19
Hi,
I'm currently developing a robot powered by two motors. I connect the motors to a driver to pin c1 and c2 (for forward) and c3 and c4 (for reverse) of PIC 16F877A. I try move left and right. When I move left, I need to make left move reverse and right motor forward. How I can do that using HPWM or PWM? I found that HPWM only support forward because it only has 2 channel.
<code>
hpwm 1, 100, 1000
hpwm 2, 100, 1000
</code>
When I try using PWM, only the last line is executed.
<code>
pwm portc.1, 100, 100 'forward right
pwm portc.4, 100, 100 'reverse left
</code>
why only last line is executed?
What is the best way to make forward reverse using hpwm or pwm. TQ
I'm currently developing a robot powered by two motors. I connect the motors to a driver to pin c1 and c2 (for forward) and c3 and c4 (for reverse) of PIC 16F877A. I try move left and right. When I move left, I need to make left move reverse and right motor forward. How I can do that using HPWM or PWM? I found that HPWM only support forward because it only has 2 channel.
<code>
hpwm 1, 100, 1000
hpwm 2, 100, 1000
</code>
When I try using PWM, only the last line is executed.
<code>
pwm portc.1, 100, 100 'forward right
pwm portc.4, 100, 100 'reverse left
</code>
why only last line is executed?
What is the best way to make forward reverse using hpwm or pwm. TQ