diff --git a/apps/hrrawexp/ChangeLog b/apps/hrrawexp/ChangeLog index bd8df3991d..a1113e1868 100644 --- a/apps/hrrawexp/ChangeLog +++ b/apps/hrrawexp/ChangeLog @@ -2,3 +2,4 @@ 0.02: Fixes 0.03: updated to work with new API and additional features added such as longer recording time and additional filtered data 0.04: added support for bangle.js 2 +0.05: Added time to output file, reallocated BTN1 to start timer. diff --git a/apps/hrrawexp/app.js b/apps/hrrawexp/app.js index d205994dfc..7df2c23b1f 100644 --- a/apps/hrrawexp/app.js +++ b/apps/hrrawexp/app.js @@ -46,7 +46,7 @@ function update_timer() { g.flip(); } -function btn2Pressed() { +function increaseTimeValue() { if (!logging_started) { if (counter < 120) counter += 15; @@ -56,7 +56,7 @@ function btn2Pressed() { } } -function btn3Pressed() { +function decreaseTimeValue() { if (!logging_started) { if (counter > 15) counter -= 15; @@ -66,7 +66,7 @@ function btn3Pressed() { } } -function btn1Pressed() { +function startTimer() { if (!logging_started) { var filename = ""; var fileset = false; @@ -127,19 +127,19 @@ var HRConfidence = 0; update_timer(); -setWatch(btn1Pressed, BTN1, { repeat: true }); +setWatch(startTimer, BTN1, { repeat: true }); //setWatch(btn2Pressed, BTN2, { repeat: true }); //setWatch(btn3Pressed, BTN3, { repeat: true }); Bangle.on("swipe",function(directionLR, directionUD){ if (1==directionLR){ - btn1Pressed(); + increaseTimeValue(); } else if (-1==directionUD || directionUD==1){ - btn2Pressed(); + startTimer(); } else if(directionLR == -1){ - btn3Pressed(); + decreaseTimeValue(); } }); @@ -147,11 +147,12 @@ Bangle.on('HRM-raw', function (hrm) { value = hrm.raw; filt = hrm.filt; //var dataArray = [value,filt,HRVal,HRConfidence]; - file.write(value + "," + filt + "\n"); + file.write(getTime() + "," + value + "," + filt + + "," + HRVal + "," + HRConfidence + "\n"); }); -/* + Bangle.on('HRM', function (hrmB) { HRVal = hrmB.bpm; HRConfidence = hrmB.confidence; }); -*/ + diff --git a/apps/hrrawexp/metadata.json b/apps/hrrawexp/metadata.json index 557b9fd89a..485c65ca9e 100644 --- a/apps/hrrawexp/metadata.json +++ b/apps/hrrawexp/metadata.json @@ -2,7 +2,7 @@ "id": "hrrawexp", "name": "HRM Data Exporter", "shortName": "HRM Data Exporter", - "version": "0.04", + "version": "0.05", "description": "export raw hrm signal data to a csv file", "icon": "app-icon.png", "tags": "",