Checkpoint Level 2
Great job! Your robot has gained some serious vision skills. But driving around the world can be dangerous for the little guy. With just a camera it’s hard to know how close you are to a wall for example.
Your robot with an additonal super power. A ultrasonic distance sensor tells him how far he is from the next barrier.
The facilitators will reinstate access to your robot, so you have full access again.
To test the distance sensor you can replace your code with this one. You may want to save your previous code somewhere.
# Drop your code here
dist = distance()
print ('Got distance -> ', dist)
print('Done')
Run the code with the run Button as usual. Hold your hand in fron of the sensor and see how tha value changes. Pretty cool. No more bumping into stuff.
Your next mission is now to drive towards a barrier as fast as possible but of course not crashing into it.
That means you will need to create loop of driving and checking the distance. You can create this more prudent or more risky.
You will not know how close to the barrier your robot will start. This is all about driving forward. No need for turns.
Once your solution is ready let the facilitator know and they will put your robot to the test.
When accomplished, continue on to the next level.