' {$STAMP BS2} ' {$PBASIC 2.5} ' {$PORT COM1} X_Offset VAR Byte '0 TO 250 Y_Offset VAR Byte '0 to 250 Lazer VAR Byte Function VAR Byte DataIn VAR Byte Laser CON 7 Servo1 CON 8 Servo2 CON 9 RS232 CON 16 Baud CON 4800 LOW Laser X_Offset = 125 Y_Offset = 125 MainLoop: PULSOUT Servo1,625+Y_Offset PULSOUT Servo2,625+X_Offset SERIN RS232,(10000/(Baud/100))-20,[WAIT("LPO"),X_Offset,Y_Offset,Lazer] IF Lazer=1 THEN LaserON GOTO LaserOFF GOTO MainLoop LaserON: HIGH Laser GOTO MainLoop LaserOFF: LOW Laser GOTO MainLoop