there and back
The ThereAndBack program will make the TriBot move forward 3 feet, turn around, and then return to where it started. Some measuring is required to solve this problem, so if your rulers are metric, feel free to change the problem to use 1 meter instead of 3 feet.
This program uses three Move blocks: one to move forward, one to spin the robot around, and one to move the robot back to where it started.
moving forward
The first block needs to move the robot forward 3 feet. “Feet” is not one of the duration options, so you need to figure out how far 3 feet is in either degrees or rotations—it doesn’t matter which you choose. I’ll use rotations for this example.
How do you figure out how many rotations you need to turn the motor to travel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access