114532 Views
101685 Views
86270 Views
54891 Views
51137 Views
49962 Views
Level Up your CAD Skills
Operation Pico
Raspberry Pi Home Hub
Hacky Temperature and Humidity Sensor
Robot Makers Almanac
High Five Bot
Using the Raspberry Pi Pico's Built-in Temperature Sensor
Getting Started with SQL
Introduction to the Linux Command Line on Raspberry Pi OS
How to install MicroPython
Wall Drawing Robot Tutorial
BrachioGraph Tutorial
KevsRobots Learning Platform
70% Percent Complete
By Kevin McAleer, 1 Minute
To prevent collisions with obstacles, use bot.distance to measure the distance between the object and your bot. If the measured distance is less than a specified threshold (e.g., 5 cm), stop the bot and move it backward to maintain a safe distance from the obstacle.
bot = Burgerbot() while true: if bot.distance <= 5: bot.stop() bot.backward(1) else: bot.forward(1)
To maintain a consistent distance from an object, first measure the distance between the object and your position. Move forward until the object is at the desired distance, then stop. If the object is closer than the desired distance, move backward until the desired distance is achieved. This process allows you to effectively follow an object while maintaining a set distance from it.
< Previous Next >