KevsRobots Learning Platform
By Kevin McAleer, 3 Minutes
BurgerBot can carry a felt-tip pen in the middle of the robot. A small SG90 servo raises and lowers it, so the robot can draw as it drives, a bit like the classic Logo turtle.
Because the pen sits between the wheels, BurgerBot can turn on the spot without smudging a curve into your drawing.
The servo turns the cog, which pushes the pen holder up and down. Fit the servo holder to the robot, slide in the pen holder, then add the cog to the servo. Test fit the pen so it slides freely but doesn’t wobble.
| Servo wire | Pico |
|---|---|
| Brown (GND) | GND |
| Red (power) | VBUS / 5V |
| Orange (signal) | GP16 |
from burgerbot import Burgerbot
from time import sleep
bot = Burgerbot()
bot.pen_up()
sleep(1)
bot.pen_down()
sleep(1)
bot.pen_middle()
If the pen doesn’t reach the paper, or lifts too far, loosen the cog, turn it a few teeth and refit it.
from burgerbot import Burgerbot
from time import sleep
bot = Burgerbot()
bot.speed = 0.3
bot.pen_down()
sleep(0.5)
for side in range(4):
bot.forward(1.5)
bot.stop()
bot.turn_right(0.8) # adjust until your corners are 90 degrees
bot.stop()
bot.pen_up()
pen_down() lowers the pen before we start moving, and sleep(0.5) gives the servo time to get therepen_up() lifts the pen at the end so the robot doesn’t leave a trail when you pick it uppolygon(sides) function that draws any regular shapeQuick quiz
Why do we sleep() after pen_down() before driving?
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments