• Cause Espruino(ESP8266) can not generate 38KHz PWM

    can you please send a snippet of the code you use to come up with this finding.

  • Yes. I searched on the forum and use these codes:

    let rawCodes =[4400,4350,550,1600,600,500,550,1650,55­0,1600,550,550,550,550,550,1600,550,550,­550,550,550,1600,550,550,550,550,550,160­0,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,5­50,550,550,550,500,600,1600,550,550,550,­500,600,1600,550,1600,600,1600,550,550,5­50,500,600,500,550,550,550,550,550,500,6­00,500,550,550,550,1600,600,1600,550,160­0,550,1650,550,1600,550].map(function(x)­ {return x/1000;});
    analogWrite(NodeMCU.D5, 0.9, {freq:38000});
    digitalPulse(NodeMCU.D5, 1, rawCodes);
    digitalPulse(NodeMCU.D5, 1, 0);
    

    And it will reboot itself during process.

  • And I had searched on the web, they said i2s can generate 38khz PWM signal, but I don't know how to write the code in Espruino, so if you know how to do with this, please teach me about it, thank you very much.

About

Avatar for MaBe @MaBe started