We've enjoyed working with the Puck.js and Espruino and are pleased to share our open source puckyActive code (MIT License) and our Program a Puck.js with puckyActive tutorial.
The code periodically wakes the Puck.js to read all the on-board sensors (battery, temperature, light, cap sense & magnetometer), then transmits the readings in an advertising packet. Any listening device in range can observe these packets and interpret the sensor readings. The readings are included as Manufacturer Specific Data, with the company code of Code Blue Communications (0x0583), our partner who introduced us to Espruino and Puck.js (thanks @billsalt !).
The goal of puckyActive is to provide a versatile and easy-to-use sensor beacon platform for education and culture of which we have a number of upcoming projects we look forward to sharing. Hope you find it as fun and useful as we do!
That looks great - thanks for posting all the code up!
In Espruino 1v95 I actually added the ability to set manufacturer data directly via setAdvertising - so you could actually remove all the low level Bluetooth stuff from initialiseAdvertisingPacket if you wanted to... Although having said that there's a lot to be said for having something that works on the firmware the Pucks come with out of the box :)
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem