
pacomms
Hi again guys, so i have another question, i am trying to write a roam script for my bot but im a little confused about how i write a script to read a sonar, below is what i have so far
I2CStart()
I2CWrite(0x42, 5)
I2CStop()
sleep(2000)
I2CRestart()
I2CWrite(0x42, 0x20, "Robot Roam Mode")
I2CStop()
:Main
forward()
sleep(2000)
if(digital(D10) < 15)
goto(stop)
goto(Main)
:stop
stop()
you can ignore the I2C stuff its just for the display, but with the echo port on D10 on my ping sonar basically if i run this script he starts moving and then stops, the sonar is reading 25 when he stops not 15 as in the script above, the main loop is what it says the main running loop the stop is well you guessed it stop, its just a test but like i said he starts of then stops, what am i doing wrong ?
Thanks
Kurt
Code:
although it does sound like you want to use the Radar control
Thanks
Kurt
Have you considered contacting sabertooth? And has anyone done any of the "tests" that i've written in other posts? i.e. using the sabertooth in R/C mode with a Vertical servo Control
I have tried contacting them but as i said in my other post they are about as helpful as a chocolate teapot so thats why i have come to the master hehe
I think most of my issues would be solved if i could put an if statement in with the sonar, like you said you might add that in so i will wait and see.
Thanks
Kurt
I'm sure there's an easy solution that I managed to overlook, but here goes
I open up EZ-B, click Add Control, then Misc, then Script and then Configure.
I type in a simple program and go to click on Save. Where does it (or should it) save the script?
Is the script only available for that session, as long as I have the EZ-B open?
Last but not least, is it possible to compose a script in Word and cut and paste into EZ-B?
Many thanks!
John