Skip to content

Commit

Permalink
Merge pull request #3 from Fitbit/jonb/versa
Browse files Browse the repository at this point in the history
Updated for Versa
  • Loading branch information
orviwan authored Mar 14, 2018
2 parents 9a60475 + 2ea7e5c commit 4622156
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 3 additions & 5 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
let document = require("document");
import { HeartRateSensor } from "heart-rate";

console.log("HR Meter app starting!");

// Fetch UI elements we will need to change
let hrLabel = document.getElementById("hrm");
let updatedLabel = document.getElementById("updated");
Expand All @@ -11,7 +9,7 @@ let updatedLabel = document.getElementById("updated");
let lastValueTimestamp = Date.now();

// Initialize the UI with some values
hrLabel.text = "-";
hrLabel.text = "--";
updatedLabel.text = "...";

// This function takes a number of milliseconds and returns a string
Expand Down Expand Up @@ -49,5 +47,5 @@ hrm.onreading = function() {
// Begin monitoring the sensor
hrm.start();

// And update the display every .5s
setInterval(updateDisplay, 500);
// And update the display every second
setInterval(updateDisplay, 1000);
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"wipeColor": "#e91e63",
"requestedPermissions": [
"access_heart_rate"
],
"buildTargets": [
"higgs",
"meson"
]
}
}
4 changes: 2 additions & 2 deletions resources/index.gui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<svg>
<text id="hrm" x="0" y="180" class="large-value">42</text>
<text id="updated" x="0" y="230" class="updated">now!</text>
<text id="hrm" x="0" y="72%" class="large-value">42</text>
<text id="updated" x="0" y="92%" class="updated">now!</text>
</svg>

0 comments on commit 4622156

Please sign in to comment.