Writing Our First ADC Program - Reading the Potentiometer
Share
Writing Our First ADC Program - Reading the Potentiometer
You will see me using an interrupt in this video because, in my opinion, interrupts rule with the ADC. The ADC is slow, and you don't want to wait around for Mrs. ADC to count up her currency. I mean, she's busy trying to determine a good way to short change you.
Oh, by the way, sometimes she gives you MORE! That's right, she may make a mistake. It turns out, she is very sensitive to sound (noise). Mrs. ADC hates the cacophony created by the outside, and even within the King Core! Let me tell you, King Core is cacophonic!! He beats these drums all day, and doesn't let anyone rest, that is unless he is resting! Becuase of all this noise, she will most likely fumble her currency and give you more than you asked for. It's really bad when the environment poses a noisy reception of voltage currency (I'm talking about breadboardville).
In this video, see how I slap a potentiometer on the bread board and read its voltage division (the potentiometer is your agent of voltage currency. Don't expect Mr. Pot to do any currency laundering! That's your job. We will use a container called Mr. Cap to do this laundering. Mr. Cap (his full name is Mr. Capacitor) and he comes in many weights. The FAT Mr. Cap will do them most laundering and clean up that currency like you can't believe. The skinny Mr. Caps will not do such a good job, but the Caps in the middle are fairly good at laundering and are the ones I like to use. the Cap family use a weight in the form of Farads. The Farad is the measure of how fat they are. The higher the Farad, the fatter Mr. Cap is. Be warned! the fatter the Cap, the slower the laundering and flow of voltage currency!
I am heavy with the Atmega32 datasheet here, but do not fear! Hold my hand throughout this process and I promise, you will get through it with a comfort of the datasheet you never thought possible. When I say datasheet, I mean databook, no kidding, I printed it out a while back, and it's heavier than my most complete C++ book. Thank goodness there are a lot of figures and illustrations!