From: Dave H. <dhy...@gm...> - 2009-06-01 05:37:37
|
HI Eli, > question two is about the AD ports... to get data from them, is there > anything special I have to do? i tried just including a2d.h and then trying > out "a2d_8(X)" where X is whatever port I was trying to access, but it didnt > seem to be behaving correctly. do I have to set up the AD ports for input or > output in some way? I know its a very basic question but any help would be > appreciated. The ADC ports need to be configured properly. If you look in the Flash-LED project, you'll see a Hardware.c file and Hardware.h file. There is a section in the InitHardware function which initializes the ADC, using some constants from Hardware.h. You should also consult the ATmega128 datasheet. There is a fairly large section on using the ADC. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ |