' ' MAX MOTOR CONTROL EXAMPLE HC11 MC VERSION ' ZAGROS ROBOTICS ' include "regs11.lib" const FORWARD = 24 const BACK = 120 const LEFT = 56 const RIGHT = 88 const STOP = 0 declare t zagros: print "MAX MOTOR EXAMPLE " print " VERSION 1/1/2000" print " (f) FORWARD" print " (b) BACK" print " (l) LEFT" print " (r) RIGHT" print " (s) STOP" print " END" print return main: pokeb baud, $30 pokeb sccr2, $0c gosub zagros print rem set portd ddrd to 4 pokeb pactl,$88 pokeb porta,0 do print "COMMAND :" do t=inkey() loop until t <> 0 if t = 358 pokeb porta,FORWARD print "FORWARD" endif if t = 354 pokeb porta,BACK print "BACK" endif if t = 364 pokeb porta,LEFT print "LEFT" endif if t = 370 pokeb porta,RIGHT print "RIGHT" endif if t = 371 pokeb porta,STOP print "STOP" endif loop until t = 288 print "PROGRAM TERMINATED"; end