What I want the robot to do is move forward 3 seconds as long as nothing is detected in its path using adc5 or adc6, ir sensors. Sensors work fine. Have tried several iterations of scripting. No matter what I try the sensors do see above 60 but the robot never stops. Posting my scripts.
Check distance script with forward movement
:MonitorDistances $leftsensor = getadc(adc5) $topsensor = getadc(adc7) $rightsensor = getadc(adc6)
if ($leftsensor 60)or ($rightsensor >60) ControlCommand("Script Manager ", ScriptStart, "Emergency_Stop") EndIf
In this particular instance I called my emergency stop script which follows...
ControlCommand("Script Manager ", ScriptStopAll) SendSerial(D0,38400,64) SendSerial(D0,38400,192)
Again robot continues to go forward without stopping. Thanks guys! ChrisSkip to comments