Analog to digital conversion

This program is using the analog to digital converter (ADC) on the opensensor to sense e.g. the light intensity in a room. Before this program can be used an external sensor such as the light sensor must be mounted to the opensensor as described here. In this case the sensor is mounted on the RB9 port.

The program is using the function readADC(); to get the ADC value which it will write to the serial interface.

The command to get an ADC measurement is:


  • getADC - Will return the ADC measurement in volt to the serial interface.





Department of Electronic Systems | Aalborg University | Niels Jernes Vej 12 | DK-9220 Aalborg | Denmark
Phone: (+45) 9635 8695 | Fax (+45) 9815 1583 | E-mail ies(at)
Copyright © 2006 Department of Electronic Systems

Last update:16-02-2009