Open Loop
The StudioBot can move around without any feedback on what the wheels are doing.
The following code will drive the robot forward for 1 second and then brake.
import time
import BBS
bot = BBS.StudioBot()
#move forward at speed 80 for 1 second
bot.forward(80)
time.sleep(1)
bot.stop()The following code shows how to turn the robot without the encoders. It's important to remember that the robot will keep turning until it is told to stop.
import time
import BBS
bot = BBS.StudioBot()
#move left for 1 second
bot.left(80)
time.sleep(1)
bot.stop()
#move right for 1 second
bot.right(80)
time.sleep(1)
bot.stop()The following code will drive the robot forward until it senses an obstacle that is 20cm or less in front of it. When it sees this obstacle it will stop.
Last updated