A self driving car's sensors!
Bolt has: light, collision (bump), speed and infared sensors.
Can you think of how these sensors might be useful in real life?
How about with something like a self driving car? (yes, a self driving car is a robot too)
With a robot like a self driving car or a vaccum cleaner robot, it needs to know what to do when there is a robot in it's path
Sphero has a sensor that could help with this - it's called "Collision".
The "On Collision" event is the first thing we need!
We need to drag things under On Collision to tell Sphero what to do when it runs into something.
Program Sphero to move forward for 2 secondsĀ
Program Sphero to ROLL BACKWARD On Collision
BONUS: Add animations when it is driving and when it hits a wall.
CHALLENGE: Make sphero KEEP ROLLING until it hits a wall!
CHALLENGE 2: Make the code only start when the light is bright enough... (hint: use the IF, Forever, Comparitor and Ambient Light blocks)