@thedamos, I noticed the funky light readings as well after running LEDs.
I wrote a Morse Code interpreter on top of a light change detector detecting ONs and OFFs of short and long pulses of light shined at the puck. To show that the interpreter is active, I blinked the RED led every few seconds and that mis-triggered the ON/OFF detection... :/
I'm sure you came across this conversation about DvDtDetector for detecting sudden value changes for switching/triggering (on Puck: Light Intensity Changes) which also shows a cross development approach in HTML5 document and browser to avoid the slowing down and battery consuming upload of code after every change... ;)
For a detail, I had puck uncovered / not covered with the silicon cap. I tried with different LEDs, but depending on the amount of ambient light, it still mis-triggered. A different or modified cap could help with the sensing part somehow shielded from the impact of the LEDs without narrowing detection angle not too much. I though do not know which part does the light detection. Is it the IR LED/part that has a built in detection?... because it uses two (2) pins of the BLE module. Putting a tube / straw on it that protrudes the cap and has a lens at the other end could work. For lens a (half) glass perl (half way pushed in) could do the light catching. The tube should reflect light on the inside wall but not let light through the wall. A metal tube or or kind of tube with aluminum foil inside should work to provide enough dynamics in light intensity guided to the detector.
© Espruino, powered by microcosm.
Report a problem