recorder 0.48: Add ability to log average acceleration values

master
Gordon Williams 2025-08-04 15:16:01 +01:00
parent 5f052d9a8f
commit 16a25f245a
4 changed files with 26 additions and 2 deletions

View File

@ -60,4 +60,5 @@
Lower accuracy of barometer data to ~1cm (saves about 15b/record) Lower accuracy of barometer data to ~1cm (saves about 15b/record)
0.47: Fix 'blip' on speed map on some recordings 0.47: Fix 'blip' on speed map on some recordings
Ensure Battery voltage is only stored to 0.01v Ensure Battery voltage is only stored to 0.01v
Add graphs for Steps+Battery Add graphs for Steps+Battery
0.48: Add ability to log average acceleration values

View File

@ -19,6 +19,7 @@ You can record
* **BAT** Battery percentage and voltage * **BAT** Battery percentage and voltage
* **Steps** Steps counted by the step counter * **Steps** Steps counted by the step counter
* **Baro** (Bangle.js 2) Using the built-in barometer to record Temperature, Pressure and Altitude * **Baro** (Bangle.js 2) Using the built-in barometer to record Temperature, Pressure and Altitude
* **Accel** Average acceleration values in X,Y and Z
* **Core** CoreTemp body temperature *if* you have a CoreTemp device and the https://banglejs.com/apps/?id=coretemp app installed * **Core** CoreTemp body temperature *if* you have a CoreTemp device and the https://banglejs.com/apps/?id=coretemp app installed
You can then start/stop recording from the Recorder app itself (and as long as widgets are You can then start/stop recording from the Recorder app itself (and as long as widgets are

View File

@ -114,6 +114,28 @@ exports.getRecorders = function() {
stop : () => {}, stop : () => {},
draw : (x,y) => g.reset().drawImage(atob("DAwBAAMMeeeeeeeecOMMAAMMMMAA"),x,y) draw : (x,y) => g.reset().drawImage(atob("DAwBAAMMeeeeeeeecOMMAAMMMMAA"),x,y)
}; };
},
accel:function() {
var ax=0,ay=0,az=0,n=0;
function onAccel(a) {
ax += a.x;
ay += a.y;
az += a.z;
n++;
}
return {
name : "Accel",
fields : ["Accel X", "Accel Y", "Accel Z"],
getValues : () => {
if (n<1) n=1;
var r = [(ax/n).toFixed(2), (ay/n).toFixed(2), (az/n).toFixed(2)];
n = ax = ay = az = 0;
return r;
},
start : () => { Bangle.on('accel', onAccel); },
stop : () => { Bangle.removeListener('accel', onAccel); },
draw : (x,y) => g.reset().drawImage(atob("DAwBAAMMeeeeeeeecOMMAAMMMMAA"),x,y)
};
} }
}; };
if (Bangle.getPressure){ if (Bangle.getPressure){

View File

@ -2,7 +2,7 @@
"id": "recorder", "id": "recorder",
"name": "Recorder", "name": "Recorder",
"shortName": "Recorder", "shortName": "Recorder",
"version": "0.47", "version": "0.48",
"description": "Record GPS position, heart rate and more in the background, then download to your PC.", "description": "Record GPS position, heart rate and more in the background, then download to your PC.",
"icon": "app.png", "icon": "app.png",
"tags": "tool,outdoors,gps,widget,clkinfo", "tags": "tool,outdoors,gps,widget,clkinfo",