Asked
— Edited
I got a 4 - in - 1 sensor and have put together a 2 wheeled balancing robot. Now I need to figure out some coding. I have the Initialization script and it works good - getting lots of data. I'm not having any luck after that. Does anyone have some scripting they would be willing to share with me to help me get going? Here's what I've got so far.
ControlCommand("MPU9150", Init)
sleep(100)
:loop
#Added these because $AccelX and $AccelY were not recognized later in the script for some reason.
$XAccel = $AccelX
$YAccel = $AccelY
if ("x" =0)
print(1)
sleep(2000)
goto(loop)
endif
ControlCommand("MPU9150", RunOnce)
if($AccelX > 1000 and $AccelX < 1000)
servo(d4,108)
servo(d6,108)
endif
print("x: " + $XAccel)
print("y: " + $YAccel)
if($AccelX > 1000)
servo(d4,120)
servo(d6,61)
print(2)
elseif ($AccelX < 1000)
Servo(d4,61)
servo(D6,120)
print( 1)
endif
Sleep(100)
goto(loop)
I am working with a code that d. cochran posted awhile ago. It will change directions when it is tipped but will never stop. Also, after it has run for 30 seconds or so it will just keep running and the only way to stop the wheels is by disconnecting the power to the EZB.
DJ, how about you go to their website and use their search. I think its about time for me to leave this forum, I get tired of seeing your smarta$$ comments. Even my 13 year old son said same thing, sad.
Apologizes for what you may have interpreted as rude - however, as stated earlier, i am unable to find the robot on robot shop website. If you wouldn't mind copying and pasting the web URL using the above instructions, it would be helpful
All you had to do was type in self balancing robot in their search box, but here is link since you could not find it. Their software is on github. What would be great is you put your software on github.
Ralph - Self Balancing Robot
Awesome! Thanks - I had a hard time finding it by the name, this helps a lot.
Thanks for the link. I also could not find it. Balance Bot had 0 hits, Balance had 2 that were unrelated. Only Balancing worked as a proper search term.
This is why many companies pay Google or Microsoft to drive their search engines. Either of them would have searched synonyms.
Alan
Could not find any videos related to this robot. confused
Strange,
I type in "balance" and in drop down menu it shows self balance robot.
But I would think proper search would be "self balancing robot", my opinion.
I have only seen one video for this robot, but the robot does has a lot of documentation online.
Interesting looking device now that I found it. A bit pricey for what it does, but this is not a cheap hobby....
Alan