'program Lynx.bas by Ron Klimas, UP362, 02/23/99 'This program controls a small robot base that has 2 modified servos 'set up for differential steering. It receives data on a 3 bit bus from 'a second processor which directs what movements to make. ' ' pin connection ' ' 7 ----------------- input from Stamp2 ' 6 ----------------- input from Stamp2 ' 5 ----------------- input from Stamp2 ' 1 ----------------- left servo control ' 0 ----------------- right servo control ' symbol lservo = 1 symbol rservo = 0 symbol mask = %11100000 'mask to isolate input bus symbol hold = %00000000 symbol right = %00100000 symbol left = %01000000 symbol forward = %10000000 symbol back = %01100000 symbol inbus = b0 'b0 and b1 are bit addressable dirs = %00000011 'define pins 1 and 0 as outputs pins = %00000000 'set all pins low (init cond.) start: inbus = pins & mask 'debug inbus if inbus=hold then ghold if inbus=forward then gforward if inbus=back then gback if inbus=right then gright if inbus=left then gleft goto start ghold: pulsout rservo,162 pulsout lservo,160 pause 10 goto start gforward: pulsout rservo,100 pulsout lservo,146 pause 10 goto start gback: pulsout rservo,200 pulsout lservo,170 pause 10 goto start gright: pulsout rservo,154 'moves right wheel slowly, need to adjust. pulsout lservo,100 'moves left wheel fast pause 10 goto start gleft: pulsout rservo,100 'moves right wheel fast pulsout lservo,154 'moves left wheel slowly, need to adjust. pause 10 goto start