I was thinking collecting sensor data from the Puck.js, and saving it. I'd have the Puck.js stuck to my lower back, or on my foot, depending on which method I'd be using, and the Bangle.js on my wrist. I'm not sure how much space is on the Puck.js, and that's why I would probably want to send it over bluetooth to somewhere, and the phone has infinite space, from this point of view. It could be good to take the data onto the Bangle.js, if it has enough space, but it seems that the sensible app collects sensor data from the Bangle.js, and then advertises that, right?
For the record, I did try to record some data to my phone this morning, using the following method: Run the code below on the Puck.js, and then open an app called nRF-Connect on the phone, connect to the Puck.js (remember to disconnect from the laptop), and the data will appear in a log file there, which can be saved on the phone. After that, the log file can be cleaned on a laptop, and we're done. It's not the most elegant solution, but at this point, nobody cares if the logfile is many megabytes. Unfortunately I had some connection issues, which I didn't resolve out in the field, but I'm sure that can be fixed.
let bla;
let mag = {"x":0, "y":0, z:"0"};
Puck.accelOn(104);
Puck.magOn(80);
Puck.on('mag', function(m) {
mag = m;
});
Puck.on('accel',function(a) {
bla = [
Date.now(),
a.gyro.x,
a.gyro.y,
a.gyro.z,
a.acc.x,
a.acc.y,
a.acc.z,
mag.x,
mag.y,
mag.z,
];
NRF.setAdvertising({}, {
name: "blabla",
manufacturer: 0x590,
manufacturerData: bla
});
console.log(bla);
});
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I was thinking collecting sensor data from the Puck.js, and saving it. I'd have the Puck.js stuck to my lower back, or on my foot, depending on which method I'd be using, and the Bangle.js on my wrist. I'm not sure how much space is on the Puck.js, and that's why I would probably want to send it over bluetooth to somewhere, and the phone has infinite space, from this point of view. It could be good to take the data onto the Bangle.js, if it has enough space, but it seems that the sensible app collects sensor data from the Bangle.js, and then advertises that, right?
For the record, I did try to record some data to my phone this morning, using the following method: Run the code below on the Puck.js, and then open an app called nRF-Connect on the phone, connect to the Puck.js (remember to disconnect from the laptop), and the data will appear in a log file there, which can be saved on the phone. After that, the log file can be cleaned on a laptop, and we're done. It's not the most elegant solution, but at this point, nobody cares if the logfile is many megabytes. Unfortunately I had some connection issues, which I didn't resolve out in the field, but I'm sure that can be fixed.