Most recent activity
-
For anyone who is interested, I've updated my night light project to support a second puck as a remote control: https://github.com/somacdivad/puckjs-nightlight.
I started to work on adding support for automatic night light activation based on low ambient light, but have had some problems with some funky reading from my Puck after the LEDs have been turned on and off again.
Once I have that figured out, I have a few other more advanced project ideas I will post here once they come to fruition :).
-
@Gordon: I think there is still something going on. I had been banging my head against my table trying to get one of my pucks controlling the other via bluetooth and kept getting the unhandled promise rejection error. Then I found this thread and updated the firmware to 1v90.5. However, that didn't solve my problem.
To make sure it wasn't something dumb on my part, I copied and pasted the code from the Controlling Other Pucks example (from the "Making it Faster" section). After pressing the button roughly 25 - 30 times I either get the error or no error displays in the console but the master puck stops controlling the other puck. The puck itself is still responsive to console commands, so it doesn't appear to be freezing or anything strange like that. My best guess is that the
busy
variable gets set totrue
and never reset when the error occurs so the code in the body of thesendToggle
function is never executed. That doesn't help understand the error, though.For completeness, the console looks like this once the error occurs:
Uncaught error: Unhandled promise rejection: undefined at line 34 col 47 ...tic.writeValue("toggle()\n").then(function() { ^ in function called from system
-
-
A color changing night light I made for my daughter: https://github.com/somacdivad/puckjs-nightlight.
We found that the night light looks best when the silicon cover is removed and then just set on top of the Puck in order to better diffuse the light from the LEDs. This makes turning the night light on and off a little bit more difficult, so I will update the project soon with code for using a second Puck as a remote control.
-
I am also having some issues with NFC. I got 2 pucks. On one the NFC URL works just fine. The other stopped working after a few hours of fooling around with it. For example, if write something like:
NRF.nfcURL('https://www.google.com');
and upload to both pucks, it works fine on one and not on the other. That said, I can not get the following code to work on either of my pucks:
NRF.on('NFCon', function() { digitalPulse(LED1, 1, 250); });
I was hoping to use NFC to be able to tap one puck on the other and pass some information. I have tried resetting the troublesome puck, but haven't had any luck. All other functions tested on the pucks have worked fine so far (bluetooth, mag, temp, etc.)
@allObjects @Ron
My guess is that the sensor works as described in this article by measuring current induced by the photodiode when exposed to light. From that article:
That would explain the choice of the red LED - it detects more of the spectrum than the other LEDs. The article also notes the following:
So, there you go. Don't turn it on.
For the simple night light project, I ended up using a second Puck as the ambient light sensor to turn the puck acting as the night light on and off. This is a decent work-around but certainly could be less than ideal for many projects.
It is unfortunate that maintaining accurate light sensor readings looks like it requires sacrificing physical feedback on the puck, at least using whats on board. One possible solution in some situations could be to use the load function, which restarts the puck and reloads the script from flash. According to the docs load() does not perform a full hardware reset, but it might reset the light sensor readings.