Puck.js trigger on light pulses (no components!) #3414
Unanswered
gfwilliams
asked this question in
Puck.js, Pixl.js, Jolt.js and MDBT42
Replies: 2 comments
-
Posted at 2020-07-28 by @allObjects Neat! Users should just be aware of not using the red LED LED1 before or any of the other LED while reading, because it most likely messes with measuring... it is light after all. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Posted at 2020-07-29 by @gfwilliams Yes - originally I'd got it lighting the Blue LED and even that was enough to set up an oscillation! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Posted at 2020-07-28 by @gfwilliams
A few days ago there was a conversation on the comments for the Puck.js electricity meter video about whether an external light sensor was actually needed.
It turns out it isn't!
Puck.js has a light measurement function, but it just uses the red LED as a photodiode to generate a little bit of voltage which can be measured when there is light.
You can use the on-chip low-voltage comparator to look at the light value from the photodiode and to wake Puck.js up - which should be pretty good for low power operation. Because Espruino doesn't natively implement an interrupt for the low power comparator you have to do some magic with the PPI system and use the fact that D11 and D12 are joined together by a resistor, but it works great!
Beta Was this translation helpful? Give feedback.
All reactions