'**************************************************************** '* Name : UNTITLED.BAS * '* Author : Min Lee * '* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 11/2/2005 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** Define OSC 4 INCLUDE "modedefs.bas" ' switch is on RC2: switchPin var portc.4 input switchPin ' H-bridge is on Rd0 and Rd1. Enable is on pin RC1 motor1Pin var portd.0 motor2pin var portd.1 speedPin var portc.1 output motor1Pin output motor2pin output speedPin ' start with speed on: high speedPin main: ` ' switch direction: if (switchPin = 1) then low motor1Pin high motor2Pin else low motor2Pin high motor1Pin endif ' blinking LED to tell that the program is still running: high portb.1 pause 50 low portb.1 pause 50 goto main