[Fwd: [Fwd: [En-Nut-Discussion] Simple analogue port F sample code?] Answer Found]

Brett Abbott Brett.Abbott at digital-telemetry.com
Fri Mar 10 10:23:02 CET 2006


  (From Original post by Ole)



  Re: reading out analog values

Hi,

here is some very short sampel code. Only showing some of the
possibilities:

ADCInit();
ADCSetChannel(0);
ADCStartConversion();
while (ADCRead(&adc_value))
    NutThreadYield();
fprintf_P(uart, PSTR("Checked power 5V: %4.1f" NL), adc_value / 1023.0 *
5.0);

This is measuring the voltage at port f0. AREF should be connected to
+5V

Bye,

Ole







More information about the En-Nut-Discussion mailing list