You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I just gave this a go on Puck.js with an LDR between D1 and D2: http://www.espruino.com/LDR

    var counter = 0;
    
    function update() {
      var a = new Uint32Array([counter]);
      NRF.setAdvertising({},{
        name: "ELEC",
        connectable : false,
        scannable : false,
        manufacturer:0x0590,
        manufacturerData:a.buffer,
        interval: 600 // default is 375 - save a bit of power
      });
    }
    
    D1.reset();
    pinMode(D2,"input_pullup");
    setWatch(function(e) {
      counter++;
      update();
      digitalPulse(LED1,1,10); // show activity
    }, D2, { repeat:true, edge:"falling" });
    
    update();
    

    It works amazingly well - I'll try and stick a video/tutorial up soon.

About

Avatar for Gordon @Gordon started