You are reading a single comment by @azer and its replies. Click here to read the full conversation.
  • There is something I missed. When the board starts, the led is off. Good. When I press the button, the led start directly and is not fading. The color jump from one to another one

    function setLeds() {
      colFade += 0.05;
      if (colFade>=1) {
        colFade = 0;
        colFrom = colTo;
        var c = E.HSBtoRGB(Math.random(),1,1);
        colTo = [ (c&0xFF)/256, ((c>>8)&0xFF)/256, ((c>>16)&0xFF)/256 ];
      analogWrite(LED1,colFrom[0]*(1-colFade) + colTo[0]*colFade, {soft:true});
      analogWrite(LED2,colFrom[1]*(1-colFade) + colTo[1]*colFade, {soft:true});
      analogWrite(LED3,colFrom[2]*(1-colFade) + colTo[2]*colFade, {soft:true});

Avatar for azer @azer started