Closed Loop

Closed loop control makes use of the wheel encoders to give feedback on how much the wheel has turned.

The following code shows how the StudioBot can be used in closed loop mode, this means the StudioBot is counting how many times the wheel encoders allow light to shine through the encoder gaps.

import board
import BBS

bot = BBS.StudioBot()

bot.forwardDistance(15, 50) #move 15cm at 50 percent power

bot.reverseDistance(15, 50)

bot.LeftTurn(90, 80) #turn 90 degrees at speed 80

bot.RightTurn(90,80) # turn 90 degrees at speed 80

Last updated