Avatar for bponce02

bponce02

Member since Nov 2023 • Last active Mar 2024
  • 2 conversations
  • 3 comments

Most recent activity

  • in Bangle.js
    Avatar for bponce02

    I've been wanting to increase the polling rate of the heart rate sensor but trying to increase the polling rate to 10ms results in the timing between the readings increasing and eventually the program will stop.
    Here is the reference of the options to increase the polling rate and the code we are running.
    http://www.espruino.com/ReferenceBANGLEJ­S2#l_Bangle_setOptions

    let i = 0;
    let t = 0;
    
    Bangle.on("HRM-raw",function(data){
     // print(data);
      if(i == 0){
        t = Date.now();
        print(t);
      }
      if(i % 10 == 0){
        n = Date.now();
        print(Date.now() - t);
        t = n;
      }
      i++;
    });
    Bangle.setOptions({"hrmGreenAdjust": false, "powerSave": true, "hrmSportMode":0, "hrmPollInterval": 10, "lockTimeout": 1000, "backlightTimeout":10000, "wakeOnBTN1": true, "wakeOnBTN2": true, "wakeOnBTN3": true, "wakeOnFaceUp": false, "wakeOnTouch": false, "wakeOnTwist": false});
    Bangle.setHRMPower(false);
    Bangle.setHRMPower(true);
    
    • 4 comments
    • 250 views
  • in Bangle.js
    Avatar for bponce02

    I'm trying to implement some type of wear detection by pulling the environment data. Maybe I'm misunderstanding how the watch does it. Do I have to rely on the other sensor to detect if something is close to the watch? I cannot replicate getting a one. Only zeros when I run the code above. I can get numbers above zero by shining my phone's flashlight, but this isn't useful for my use case.
    I've been looking at this code snippet from the source code. https://github.com/espruino/Espruino/blo­b/master/libs/misc/hrm_vc31.c#L376

  • in Bangle.js
    Avatar for bponce02

    I've been doing some quick tests on my Bangle running 2v19. However, I'm not sure what the output of this event is supposed to mean. All I get when I run this is zeros. Is this expected functionality?

    Bangle.setHRMPower(1);
    Bangle.setOptions({hrmPushEnv:true});
    Bangle.on('HRM-env', function(env) {
        console.log(env);
    });
    
Actions