Ultrasonic Collision Detection icon Ultrasonic Collision Detection — Stops robot movement (no steering) when an EZB-connected ultrasonic sensor detects an object within a set range; integrates with scripting and paused polling. Try it →

ARC Pro

Upgrade to ARC Pro

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

Author Avatar
PRO
Belgium
Thingiverse
#17  

ControlCommand("MPU9150", Init)

sleep(100)

:loop #Added these because $AccelX and $AccelY were not recognized print("Start of loop") $XAccel = $AccelX $YAccel = $AccelY

if ($AutoPositionStatus = true)

print("AutoPositioner already running...")

sleep(2000)

goto(loop)

endif

ControlCommand("MPU9150", RunOnce) $XAccel = $AccelX $YAccel = $AccelY print ("x: " + $XAccel) print ("y: " + $YAccel)

if ($YAccel > 8000)

print("Getting up from front")

ControlCommand("Auto Position", AutoPositionAction, "Getup")

waitfor($AutoPositionStatus = false) $XAccel = $AccelX $YAccel = $AccelY

print ("x: " + $XAccel) print ("y: " + $YAccel)

ELSEif ($YAccel < -8000)

print("Getting up from rear")

ControlCommand("Auto Position", AutoPositionAction, "stand from sit")

waitfor($AutoPositionStatus = false) $XAccel = $AccelX $YAccel = $AccelY

print ("x: " + $XAccel) print ("y: " + $YAccel)

endif

sleep(500) $XAccel = $AccelX $YAccel = $AccelY

print("End of loop...Restarting") goto(loop)

thank you d.cohran

Author Avatar
PRO
Belgium
Thingiverse
#18  

forgot to check solved

Author Avatar
United Kingdom
YouTube
#19  

Great solve David, and I'm pleased you got everything sorted now nomad.:)

Author Avatar
PRO
Belgium
Thingiverse
#20  

steve g

thats two jd's getting up now.d.cohran is good programmer.