You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi - are you doing this with a normal Espruino, or Puck.js?

    On normal Espruino it should be as easy as:

    var pulseTimes = [4400,4350,550,1600,600,500,550,1650,550­,1600,550,550,550,550,550,1600,550,550,5­50,550,550,1600,550,550,550,550,550,1600­,550,1600,600,500,550,1650,550,550,550,1­600,550,1600,600,1600,550,1600,550,550,5­50,1600,600,1600,550,1600,600,500,550,55­0,550,550,550,500,600,1600,550,550,550,5­00,600,1600,550,1600,600,1600,550,550,55­0,500,600,500,550,550,550,550,550,500,60­0,500,550,550,550,1600,600,1600,550,1600­,550,1650,550,1600,550].map(function(x) {return x/1000;});
    
    analogWrite(IR_ANODE,0.9,{freq:38000});
    digitalPulse(IR_CATHODE, 1, pulseTimes);
    digitalPulse(IR_CATHODE, 1, 0);
    digitalRead(IR_ANODE);
    

    So all I did is divide the times by 1000 to get them in milliseconds rather than microseconds.

About

Avatar for Gordon @Gordon started