This animation demonstrates how sensors work on a real robot. When you click the green flag, the robot drives around the track. Each color signals the robot to play a different musical note.
This idea was inspired by some real robots created by artist Yuri Suzuki, called Color Chasers. http://www.spoon-tamago.com/2014/12/04/color-chasers-yuri-suzuki-robots-color-into-sound/ The Scratch project was developed for the 2nd edition of my Robotics book from Nomad Press. https://nomadpress.net/nomadpress-books/robotics/