Can we turn #PineCone #BL602's LED into a Light Sensor ... By reading it with ADC? 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/adc/customer_app/sdk_app_adc/sdk_app_adc/demo.c
Yep #PineCone #BL602's Blue LED works as a Light Sensor (I think) ... But only in Sunlight 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/adc/customer_app/sdk_app_adc/sdk_app_adc/demo.c
Why does our #BL602 Light Sensor work only in Sunlight? I'm guessing: 1️⃣ Because our LED is Blue 2️⃣ Sunlight is intense (especially in Singapore)
https://wiki.analog.com/university/courses/electronics/electronics-lab-led-sensor?rev=1551786227
Remember this awful hack for setting the #BL602 ADC Gain? Let's do this The Right Way with the ADC Low Level HAL
https://github.com/lupyuen/bl_iot_sdk/blob/adc/components/hal_drv/bl602_hal/bl_adc.c#L339-L367
Here's the right way to set #BL602 ADC Gain ... By calling the BL602 ADC Standard Driver
Sadly #BL602 ADC High Level HAL won't let us average the ADC Samples ... So we rewrite our firmware to call ADC Low Level HAL instead
https://github.com/lupyuen/bl_iot_sdk/blob/adc/customer_app/sdk_app_adc2/sdk_app_adc2/demo.c