• Yes, I'll get hold of some of proper receivers - that should help a lot. Once I figure out how to get compiled code running in an irq working reliably, Espruino should be able to handle even the garbage coming in pretty well though.

    I actually spent a while yesterday with this: https://github.com/gfwilliams/RadioRecei­ver

    Trying to get it to decode AzzyRF. Not sure if I'm doing something wrong, but I had no luck at all - I guess it's possible it's just a bit too fast for the cheap receiver + audio input :(

    If it helps I did this (rough) code for transmission from Espruino which seems to do about the right stuff - albeit without the actual packet formation:

    function transmit(pin, data, callback) {
      var pulses = [];
      // 30 training pulses
      for (var i=0;i<30;i++)
        pulses.push(0.2,0.2);
      // 2ms delay off after training pulses
      pulses[pulses.length-1] += 2;
      // output data, MSB first
      data.forEach(function(byte) {
        for (var b=7;b>=0;b--) {
          // on for 0.55ms if 1, 0.3ms if 0, then off for 0.42ms
          pulses.push((byte&1)?0.55:0.3, 0.42);
          byte<<=1;
        }
      });
      // make sure we end on a low signal
      pulses.pop();
      // nowstart pulses
      digitalPulse(pin,1,pulses);
      // work out how long to wait for and call callback after  
      if (callback) {
        var msecs = E.sum(pulses)+2;
        setTimeout(callback, msecs);
      }
    }
    
About

Avatar for Gordon @Gordon started