1 input : Sonar with distance data

1 output : speaker with different music

Function:

when object distance <= 10 cm —–play default music

when object 20 cm <= distance <= 40 cm ——play fur elise


circuit wiring :

20160916_092614

Code Sources:

Read Sonar Demo

Sound Demo