• Ok, this is great!

    So looking at it, the small pulses are roughly 1.5ms. Looking at the document you posted up earlier, the actual 'clock rate' they're talking about is half that... so 1000ms/3ms = 333Hz - which looks extremely similar to the 342Hz clock rate they give for Version 1.0 devices!

    So now we know the clock rate, we can just modify the timing in the code I gave before. With it there's a description of how the *1000 was worked out...

    Basically now we're expecting pulses between 1.5ms and 3ms (ish), so the midpoint is 2.25ms. So that means we just multiply by 1000/2.25 = 444

    var data = "";
    var last = 0;
    function onEdge(e) {  
      var d = 0|((e.time-e.lastTime)*444);
      if (d==0) {
        if (e.state) data+=last;
      } else if (d==1) {
        data+=last^=1;
      } else {
        console.log(data);
        data = "";
        last = 1;
      }  
    }
    setWatch(onEdge, B15, { edge:"both", repeat:true });
    

    Hopefully if you use that code, you should get something back. If you're really lucky it'll start with twelve 1 bits... Although it looks from the docs you gave like the format is actually:

    • 12 1 bits
    • a 4.2ms gap with nothing in
    • a 5.7ms pulse of radio waves
    • a 5ms gap with nothing in
    • The actual data

    So I think the current code may give you 12 1s, then on a new line it'll give you the data.

About

Avatar for Gordon @Gordon started