View Single Post
  #3   Spotlight this post!  
Unread 13-02-2008, 21:21
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Printing Analog Input with Kevin's new code

Quote:
Originally Posted by psy_wombats View Post
It should be normal, something like:

Code:
        for (k = 1; k <= NUM_ADC_CHANNELS; k++) {
            printf("ADC %d: %d\r\n", k, Get_ADC_Result(k));
        }
If you want to get fancy. Make sure the number of ADC channels is set correctly in adc.h. This looks more like an electrical problem though. You may want to check with an oscilloscope that you are actually getting values from the ADC.
Get_ADC_Result() returns an unsigned int, so you'll want to use %u in your printf() format string instead of %d.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org