dim Time as integer
dim MotorState as integer
Time = 500 ' 500mS
MotorState = 0
Top:
if MotorState = 0 and gettimerstate(1) = 1
settimercount(1, Time)
setcommand(_G, 1, 500)
else
setcommand(_GO, 1, 0)
end if
MotorState = 1
if motor state = 1 then terminate
goto top