NRF_setAdvertising

Posted on
  • gordon
    Is there some Espruino example that sends Advertising of state (for example) of 4 analog inputs each 3 seconds ?
    In meantime sleeps ?

  • The easiest is probably just:

    function update() {
      var data = [
        analogRead(D2)*255,
        analogRead(D3)*255,
        analogRead(D4)*255,
        analogRead(D5)*255,
      ];
      NRF.setAdvertising({},{
        manufacturer:0x0590,
        manufacturerData:data
      });
    }
    
    setInterval(update, 3000);
    
  • Gordon
    Thanks to help me! Today i compiled your ESPRUINO to NRF51822 (a chineses beacon) and run it. I can see with your WEB IDE the NRF51822 after scanning. Wheni try to connect say "CONNECTING" and nothing happens! Any tip ? Thanks!!!!!!!!

  • Which board file you started with?
    I tried a the Micro:bit firmware on a Xiaomi humidity sensor with nRF51822, and did work at first try.
    What kind of beacon? Can it provide enough energy to the uC? Although a single coin cell should be enough, but still...

  • Hummm, good tip to use the Micro:Bit firmware :)
    I will compile with that! Did you compile it ?
    I used this attached!

    I had gave up to use the ESPRUINO and choose Nordic SDK C where i make work the NRF51802 and NRF51822.

    But, now! I want to back to ESPRUINO!!!! Much better! I will test soon and thanks AkosLukacsPatreon

    And thanks gordon!


    1 Attachment

    • Sem título.png
  • Worked!!!!!!!!!!!!!!!!

    Btw, is there any example to read the Battery value without create a SERVICE on ESPRUINO ? btw, i dont want to make a conenction to read the Battery, i want it during broadcasting...

  • There is an official downloadable build for the Micro:Bit https://www.espruino.com/Download
    I used that first with the 51802, and after that built my own with (removed the microbit specific code).
    Here is the thread with more info: http://forum.espruino.com/conversations/­333666/ and the board file: https://gist.github.com/AkosLukacs/d37aa­8663943dbd976279fc4cfa7c785

  • WOW!
    thank you so much

  • Sat 2019.09.28

    'is there any example to read the Battery value'

    http://www.espruino.com/Reference#l_E_ge­tBattery

    Note: This is only available in Puck.js devices and Pixl.js boards



    See link:
    'How do I measure battery voltage on devices that don't have E.getBattery?'

    https://www.espruino.com/Tips+and+Tricks­

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

NRF_setAdvertising

Posted by Avatar for user95229 @user95229

Actions