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.