' PicBasic Pro Code for Motor ' Created by Jenny Chowdhury and Cory Forsyth ' Updated 15 Nov 2005 ' email cory d0t forsyth {@} gmail ' switch is on RC4: switchPin var portc.4 input switchPin ' H-bridge is on RC2 and RC3. Enable is on pin RC1 motor1Pin var portd.2 motor2pin var portd.3 speedPin var portc.1 output motor1Pin output motor2pin output speedPin ' start with speed on: high speedPin main: 'switch direction: If (switchPin = 1) then high portb.7 low motor1Pin high motor2Pin else 'PAUSE 500 low portb.7 low motor2Pin high motor1Pin endif ' PAUSE 500 goto main