Exercise
You must make a circuit that will turn a Direct Current (DC) motor at full power pressing one button, and at half power pressing another. The DC motor stops spinning when no button is pressed.
Answer the following questions in a multiline comment at the end of your code
1. What is Pulse Width Modulation (PWM) and how does it work?
2. How can you tell which Arduino pins have PWM?
3. What are the maximum and minimum values of the analogRead function? What are the maximum and minimum values of the analogWrite function?
Extension
Have the motor speed be controlled by a sensor rather than a button. You can use a potentiometer, a temperature sensor, or any other sensor you like (if you feel like researching a new one)
Scoring
Completing the exercise 50%
Answering the 3 questions 30%
Extension 20%
Total 100%