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,550,550,550,1600,550,550,550,550,550,1600,550,1600,600,500,550,1650,550,550,550,1600,550,1600,600,1600,550,1600,550,550,550,1600,600,1600,550,1600,600,500,550,550,550,550,550,500,600,1600,550,550,550,500,600,1600,550,1600,600,1600,550,550,550,500,600,500,550,550,550,550,550,500,600,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.
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi - are you doing this with a normal Espruino, or Puck.js?
On normal Espruino it should be as easy as:
So all I did is divide the times by 1000 to get them in milliseconds rather than microseconds.