Tutorial 3: Fun With Pot and Vibrators

Buzzy BasicsBuzzy 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
    • Huh?
    • 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
  • buzzzZZZZZzzzzZZZZZzzz!

Copyright Mike Edwards 2006-2009. All content available under the Creative Commons Attribution ShareAlike license, unless otherwise noted.