Avatar for user128987

user128987

Member since May 2021 • Last active Jun 2021
  • 1 conversations
  • 1 comments

Most recent activity

    • 1 comment
    • 500 views
  • in Bangle.js
    Avatar for user128987

    Hello everyone,
    currently I'm developing an application for my bachelor's thesis and I want to control the watch via BLE on my phone.

    I have already established a connection and can discover and read the characteristics of the watch. What I want to achieve is also writing to a characteristic and reading it with the watch (to turn on/off the Heart Rate Sensor etc.). Is there a function which monitors the watch's writable characteristics/services? And if not how should I approach this? (Or is this even the right way to do it? )
    Much thanks in advance.. If you need further info / code I'm happy to provide it.

    Greetings

    EDIT: I've found it :)

    NRF.setServices({
      0xBCDE : {
        0xABCD : {
          writable : true,
          onWrite : function(evt) {
            digitalWrite([LED3,LED2,LED1], evt.data[0]);
          }
        }
      }
    });
    
Actions