5. Hysteresis
Implement a hysteresis, emulating a thermostat (using potentiometer in A0). If the value is above 2000, turn on the LED
D12, if the value is below 800, turn it off. Otherwise, keep it as it is.
5
6. Wait until and break loop
The LED connected at D12 will start blinking when the switch D2 is pressed. It will stop blinking when the switch D3 is
pressed.
6
7. Alarm effect
Generate an alarm effect using the buzzer connected to
pin D5.
Start with a base frequency of 1318.51Hz and increase
the frequency 3% on each iteration until reaching
1567.98Hz with a duration of 22ms.
Then reset the value of the frequency and increase its
value 4% until reaching 2349.32Hz with a duration of
12ms.
7