pushups: more tuning
parent
120a47fed7
commit
cb5a42996c
|
|
@ -49,18 +49,18 @@ function default_routine() {
|
||||||
|
|
||||||
const DETECTORS = [
|
const DETECTORS = [
|
||||||
(xyz) => {
|
(xyz) => {
|
||||||
if (xyz.y > 0.3) {
|
if (xyz.y > 0.15) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (xyz.y < 0.2) {
|
} else if (xyz.y < 0.1) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(xyz) => {
|
(xyz) => {
|
||||||
if (xyz.x > 0.15) {
|
if (xyz.x > 0.075) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (xyz.x < -0.15) {
|
} else if (xyz.x < -0.075) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -167,6 +167,10 @@ class FitnessStatus {
|
||||||
|
|
||||||
if (this.completed) {
|
if (this.completed) {
|
||||||
Bangle.buzz(1000).then(() => {
|
Bangle.buzz(1000).then(() => {
|
||||||
|
Bangle.setPollInterval(80); // default poll interval
|
||||||
|
Bangle.accelWr(0x18, 0b01101100); // off, +-4g
|
||||||
|
Bangle.accelWr(0x1B, 0x0); // default 12.5hz output
|
||||||
|
Bangle.accelWr(0x18, 0b11101100); // +-4g
|
||||||
load();
|
load();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
@ -239,16 +243,28 @@ class FitnessStatus {
|
||||||
let status = new FitnessStatus(10 * 60);
|
let status = new FitnessStatus(10 * 60);
|
||||||
// status.display();
|
// status.display();
|
||||||
|
|
||||||
// Bangle.accelWr(0x18,0b01110100); // off, +-8g // NOTE: this code is taken from 'accelrec' app
|
|
||||||
// Bangle.accelWr(0x1B,0x03 | 0x40); // 100hz output, ODR/2 filter
|
|
||||||
// Bangle.accelWr(0x18,0b11110100); // +-8g
|
|
||||||
Bangle.setPollInterval(10);
|
|
||||||
|
|
||||||
|
|
||||||
function start_routine() {
|
function start_routine() {
|
||||||
|
|
||||||
|
Bangle.accelWr(0x18,0b01110100); // off, +-8g // NOTE: this code is taken from 'accelrec' app
|
||||||
|
Bangle.accelWr(0x1B,0x03 | 0x40); // 100hz output, ODR/2 filter
|
||||||
|
Bangle.accelWr(0x18,0b11110100); // +-8g
|
||||||
|
Bangle.setPollInterval(10);
|
||||||
|
|
||||||
|
Bangle.setPollInterval(80); // default poll interval
|
||||||
|
Bangle.accelWr(0x18, 0b01101100); // off, +-4g
|
||||||
|
Bangle.accelWr(0x1B, 0x0); // default 12.5hz output
|
||||||
|
Bangle.accelWr(0x18, 0b11101100); // +-4g
|
||||||
status.remaining = status.routine[status.routine_step][1];
|
status.remaining = status.routine[status.routine_step][1];
|
||||||
|
Bangle.setPollInterval(80); // default poll interval
|
||||||
|
Bangle.accelWr(0x18, 0b01101100); // off, +-4g
|
||||||
|
Bangle.accelWr(0x1B, 0x0); // default 12.5hz output
|
||||||
|
Bangle.accelWr(0x18, 0b11101100); // +-4g
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
|
Bangle.setPollInterval(80); // default poll interval
|
||||||
|
Bangle.accelWr(0x18, 0b01101100); // off, +-4g
|
||||||
|
Bangle.accelWr(0x1B, 0x0); // default 12.5hz output
|
||||||
|
Bangle.accelWr(0x18, 0b11101100); // +-4g
|
||||||
|
|
||||||
Bangle.on("swipe", function (directionLR, directionUD) {
|
Bangle.on("swipe", function (directionLR, directionUD) {
|
||||||
if (directionUD == -1) {
|
if (directionUD == -1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue