Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
ReverseL:
BSF PORTC, RL ;set pins for reverse
BCF PORTC, FL
RETURN
ReverseR:
BSF PORTC, RR
BCF PORTC, FR
RETURN
ForwardL:
BCF PORTC, RL ;set pins for forward
BSF PORTC, FL
RETURN
ForwardR:
BCF PORTC, RR
BSF PORTC, FR
RETURN
PORTA=0xFF; //set PORTA to output +5V
PORTB=0xFF; //set PORTB to output +5V
while(1)
{
TRISA=0x00; //set PORTA to be outputs
TRISB=0xFF; //set PORTB to be inputs
delay(100); //some sort of time delay
TRISB=0x00; //set PORTB to be outputs
TRISA=0xFF; //set PORTA to be inputs
delay(100); //some sort of time delay
}
Just BSF the pin you want high, and BCF the pin you want low.
Here are some examples from my PWM 'tutorial'.
Code:ReverseL: BSF PORTC, RL ;set pins for reverse BCF PORTC, FL RETURN ReverseR: BSF PORTC, RR BCF PORTC, FR RETURN ForwardL: BCF PORTC, RL ;set pins for forward BSF PORTC, FL RETURN ForwardR: BCF PORTC, RR BSF PORTC, FR RETURN
ReverseL:
BSF PORTC, RL ;set pins for reverse
nop
BCF PORTC, FL
RETURN