It starts by setting the pull pin as A2 and puts it as up. It then sets the volume of the sound it will make to 128. It then checks if the digital A2 pin is not true. If it is not true then it reads the input for analog pin A1 from the potentiometer to set a value. It then sets the tone it plays using the value and plays it at 1/8 beat. If the switch is flipped then the sound is turned off.
Lab 1
It turns sound on and off with a switch. The tone is changed with a potentiometer.
Read more
Comments
Please log in or sign up to comment.