Programming Digital Potentiometer AD5220
Hinko
Posts: 1
Does anyone know how to code a digital pot so it will stay at one value and the debug window will TELL ME what that value is in OHMS?
I have a digital pot providing resistance to a 555 chip (like the exercise in the "What's a Microcontroller?" book). I am using the resultant resistance to drive the frequency of the output of the 555 into a transistor which goes out to a speaker.
I am using a set up similar to what's described in "The Microcontroller Application Cookbook" for Output: Speaker. Is it possible to control the frequency so I can control the tone?
PLEASE HELP!
THANKS.
Heidi
Comments
If you want to display the resistance, declare a new word variable, and set it equal to the tap setting multiplied by 78. For example:
R VAR Word
.
.
.
R = newTapSetting * 78
DEBUG "R = ", DEC R, "Ohms"
What's a Microcontroller v2.2 (the latest) is available for free download from www.parallax.com -> Downloads -> Stamps in Class Tutorials.