• I'm just trying to PWM a LED and noticed that the only 2 output I could use for analogWrite were the DACs, all other PWM pins result in:

    analogWrite(A0, 0.2)
    ERROR: Pin A0 is not capable of PWM Output

  • This should work just fine. I just tested it out with the exact same pin.

    Have you updated to the latest version of the Espruino software? Could you also tell some more on how you wired up the LED? Finally, could you try just typing analogWrite()? This should give you a list of all the pins capable of PWM.

  • Have you updated to the latest version of the Espruino software?
    I will try to update from 1v43 to 1v46.

    Could you also tell some more on how you wired up the LED?
    Ground -> LED -> 100 Ohm -> C6. It lights up with digitalWrite(C6, 1);

    Finally, could you try just typing analogWrite()?

    analogWrite()
    ERROR: Pin UNKNOWN is not capable of PWM Output
    Suitable pins are:
    A0 A1 A2 A3 A6 A7(AF) A8 A9 A10
    A11 B0 B1 B3(AF) B4(AF) B5(AF) B6 B7 B8
    B9 B10(AF) B11(AF) B13 B14 B15 C6 C7(AF) C8
    C9(AF)
    Or pins with DAC output are:
    A4 A5

    I'm pretty sure it is the software version if it works (and is in the documentation!)

  • I have indeed updated to the latest version. My wiring is exactly the same as yours, so I can't think of any reason why digitalWrite wouldn't work! I think it would indeed be best to first update the software and try again.

  • just typed analog.Write(A0,0.2) in terminal window and got an error (using .operator on non object....
    sending vom Editor window works, at least I don't get an error
    1v46 on Espruino board

  • And yes, of course, it was the because of version 1v43, not all of my boards were up to date.

  • @JumJum the command is analogWrite, so without the dot in between

  • @Kim, thanks a lot, often problems are located between the ears :-)

  • Great - so all sorted now?

  • Yes Gordon, the new version fixes it all. thanks for the follow up :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

analogWrite on any PWM pin result in: not capable of PWM Output

Posted by Avatar for TiCPU @TiCPU

Actions