This movie shows you how to connect your sonar sensor and explains the code you need to program it.
NOTE: the Year 10 board has been upgraded since this movie was made. Now the pins are labelled +5, Gnd, Tx and Rx. You connect each pin on your printed circuit board to the pin with the same label on the sonar unit. Please make sure you get this right, or the components can get damaged.
This movie shows you basic code to get your sonar working.4
NOTE: The Y10 board has been upgraded since this movie was made. trigPin is now 7 and echoPin is now 6. (not what it says in the movie.) You will need to change the first two lines of the code to get this correct.
This movie shows you how to create your own function for reading a sonar sensor.
This movie shows you how to use your sonar sensor to help your robot avoid obstacles.