From 5a39df143962f010f07609cfdccae42b4b7973d6 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sat, 28 May 2016 19:40:52 +0100 Subject: [PATCH] Demonstrate ALS support in the CC26xx demo --- examples/cc26xx/cc26xx-demo.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/cc26xx/cc26xx-demo.c b/examples/cc26xx/cc26xx-demo.c index 53c607837..50d2190d3 100644 --- a/examples/cc26xx/cc26xx-demo.c +++ b/examples/cc26xx/cc26xx-demo.c @@ -337,6 +337,15 @@ get_sync_sensor_readings(void) value = batmon_sensor.value(BATMON_SENSOR_TYPE_VOLT); printf("Bat: Volt=%d mV\n", (value * 125) >> 5); +#if BOARD_SMARTRF06EB + SENSORS_ACTIVATE(als_sensor); + + value = als_sensor.value(0); + printf("ALS: %d raw\n", value); + + SENSORS_DEACTIVATE(als_sensor); +#endif + return; } /*---------------------------------------------------------------------------*/