Tutorial 3: Fun With Pot and Vibrators
Buzzy BasicsOkay, actually, that's a pot as in potentiometer. Nyuk, nyuk. Anyway, let have some fun here!
- Connect pot to analog in pin
- Connect vibrator to PWM out pin
- Get the input for the analog in
- Scale the input
- Scaling adjusts the input values of 0 - 1024 to a different range that we can use
- In this case, we want the output to be from 0 to 127
- write the output to the PWM pin