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
Need to enable ADC Gain when reading the #BL602 LED ... By modding the BL602 ADC HAL source code 🙄
https://github.com/lupyuen/bl_iot_sdk/blob/adc/components/hal_drv/bl602_hal/bl_adc.c#L339-L367
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
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
Let's convert our #BL602 ADC Firmware to #RustLang ... By calling the Rust Wrapper for BL602 IoT SDK
https://qoto.org/@lupyuen/106632937849697683