[En-Nut-Discussion] reading out analog values

Ole Reinhardt ole.reinhardt at kernelconcepts.de
Tue Jun 14 11:22:18 CEST 2005


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


-- 
kernel concepts    Tel: +49-271-771091-14
Dreisbachstr. 24   Fax: +49-271-771091-19
D-57250 Netphen    E+ : +49-177-7420433
--





More information about the En-Nut-Discussion mailing list