[ Log In ]
Image of the Atmega324p

Atmega324P

$8.50
Qty:
USB AVR programmer

USB AVR Programmer

$9.95
Qty:
Breadboard adapter for the USBasp AVR Programmer

USBasp Breadboard Breakout Adapter

$4.90
Qty:
Thumbnail: Crystal Oscillator 18.432 MHz for UART

18.432 MHz Crystal Oscillator 18pf 30ppm

$0.94
Qty:
Thumbnail: 22 pF Capacitor

22 pF Multilayer Ceramic Capacitor

$0.43
Qty:
Thumbnail: Quartz crystal oscillator - 16 MHz

16 MHz Crystal Oscillator 20 pF Through Hole

$0.75
Qty:
3 pin slide switch

SPDT Slide Switch 3 pin 30V

$1.49
Qty:
10K timmer potentiometer

10K Trimmer Potentiometer (Through Hole)

$0.85
Qty:
20k trimmer potentiometer

20K Through Hole Trimmer Potentiometer

$0.85
Qty:
50K Potentiometer Panel Mount

50K Potentiometer Panel Mount (Non Trimmer)

$1.49
Qty:
Skip Navigation Links

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!