You are reading a single comment by @Terrence7 and its replies. Click here to read the full conversation.
  • although I'd still recommend that you use the counter method if you want to be sure you don't miss things happening.

    My IOT hub will be a rpi3. I plan on capturing the battery reading when the lid has been opened, and thus will only be one hit a day. In my else statement I send a 0, though you are recommending a count.

    I don't plan on doing anything with the count, but I am interested in your suggestion, please tell me more about how this will help. (a bit slow here :) )

    Here is the current state of my code:

    function sendAdvert() {
      if(Puck.light() > 0.50){
        NRF.setAdvertising({0x180F : [Puck.getBatteryPercentage()]});
      }
      else{
       NRF.setAdvertising({0xFFFF:[0]});
      }
    }
    
    setInterval(sendAdvert, 1500);
    digitalRead(LED1);
    NRF.setTxPower(4);
    
    
About

Avatar for Terrence7 @Terrence7 started