Display Utilities
57
DMI-1040
5.2
Reading the Ambient Light Sensor
The DMI-1040 is equipped with an Everlight DCDIC-17 ambient
light sensor. Below is a sample application to read out the ADC
values and calculate the illuminance in lux.
// visit folder to compile application
# cd $APP_ALS/
# gcc als_read.c -o als_read
//perform test application to read out Lux value
# ./als_read
//sample logs
root@adlink-SP-AL:/home/adlink/ALS# ./als_read
[DBG] :seeking /dev/i2c-1
[DBG] :write data 0x00 fail
[DBG] :read data failure
[DBG] :seeking /dev/i2c-2
[DBG] :write data 0x00 fail
...
[DBG] :read data failure
[DBG] :seeking /dev/i2c-10
[DBG] :write data 0x00 fail
[DBG] :read data failure
[DBG] :seeking /dev/i2c-11
[DBG] :found
[DBG] :UPDATE=0x01
CH0=3092
CH1=962
LUX=19.170000
[DBG] :UPDATE=0x01
CH0=3104
CH1=966
LUX=19.241999
Summary of Contents for DMI-1040
Page 8: ...viii Table of Contents This page intentionally left blank...
Page 10: ...x List of Figures This page intentionally left blank...
Page 12: ...xii List of Tables This page intentionally left blank...
Page 27: ...Getting Started 15 DMI 1040 6 Disconnect the cable connecting the speakers to the main board...
Page 40: ...28 Getting Started This page intentionally left blank...
Page 45: ...Driver Installation 33 DMI 1040 Click Next The system will begin installing the Wi Fi driver...
Page 66: ...54 Driver Installation This page intentionally left blank...