>analogWrite(LED1, 0.5);
Pin B2 is not capable of PWM, available pins are:
...
Or use software pwm with analogWrite(pin, val, {soft:true});
>analogWrite(LED1, 0.5, {soft:true});
... now works
This would gently discourage people from using software PWM (with it's potential impact on performance and constant interrupts happening in the background), while still making the route to use software PWM clear. I don't think we should be letting people use an inferior PWM mode without them knowing that they are.
Is anyone having a problem with there not being enough PWM pins on the Espruino?! How do you use that many PWM pins?!
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.
I prefer this:
This would gently discourage people from using software PWM (with it's potential impact on performance and constant interrupts happening in the background), while still making the route to use software PWM clear. I don't think we should be letting people use an inferior PWM mode without them knowing that they are.
Is anyone having a problem with there not being enough PWM pins on the Espruino?! How do you use that many PWM pins?!