NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » ADC help

October 15, 2011
by sonicgadgets
sonicgadgets's Avatar

Going to start off stating that I'm NEW to this. I'm looking at the NERDKIT demo for Temp sensor, and I cannot figure out what code actually links the ADC to PIN 23 (PC0/ADC0). I guess my question is if I wanted to measure something else as well how could I point my code to the next pin (ADC1 or ADC2)? Sorry if i'm asking a stupid question but got to learn some how.

-John

October 15, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi John,

You want to look at the ADMUX register to multiplex between the different inputs to the ADC. This forum post goes over how to sample from different analog signals.

Humberto

October 15, 2011
by sonicgadgets
sonicgadgets's Avatar

Thank you I think thats what I want.

So to recap I would change: ADMUX = 1; or ADMUX = 2;

  • Thank you JOHN

Post a Reply

Please log in to post a reply.

Did you know that binary numbers use base 2 to represent numbers, and these are important for understanding microcontroller registers? Learn more...