Successfully Added To Cart

EXERCISE SOLUTIONS:

Question 1

100 represents the minimum frequency that can be output to the buzzer.
1000 represents the maximum frequency that can be output to the buzzer.
You can use these numbers to create a fixed range of accessible tones.

Question 2

A smaller range value creates a wider range of frequencies.
A larger range value narrows the range of frequencies.
You should notice in the Serial Monitor that frequencies jump in increments of whatever the value of range is.

Question 3

You will have to change this line of code:

pitch = analogRead(LDR2)/100 + 1;

To this:

tempo = analogRead(LDR2)/100 + 1;

Bonus Question

Pitch = 1023 / 100 + 1 = 11.23
frequency = 1023 * 11.23 = 11,488.29
frequency = 100 * ((11,488.29 + 50) / 100)

= 11,538.29 Hz

Pitch = 0 / 100 + 1 = 1
frequency = 0 * 1 = 0
frequency = 100 * ((0 + 50) / 100)

= 50 Hz

Google Tracking
Pinterest Tracking