• Sat 2019.11.23

    Needs to be verified with an oscilloscope


    Found this example that suggests two pins of the same prefix should work


    Doesn't indicate that only one instance of analogWrite() may exist

    I originally thought this to be the number suffix when using setWatch(),

    'Note: The STM32 chip (used in the Espruino Board and Pico) cannot watch two pins with the same number - eg A0 and B0.'

    but after eliminating unnecessary code, found to be repeatable on other pins also.

    // 0.001 sec or 1msec or 100Hz
    // A0 PWM out - 10% duty cycle hi
    function a0() {
      analogWrite( A0, 0.1, { freq : 100 } );
    // 0.1 sec or 100msec or 1Hz
    // A5 PWM out - 10% duty cycle hi
    function a5() {
      analogWrite( A5, 0.1, { freq : 1 } );

    Run a0() - See Orn D3 output


    Run a5() - See Pur D7 output


    Run a0()
    Run a5() - See duplicated output - should be different!!

    A0 Orn D3 is being assigned the last defined analogWrite() A5

    Also tried with combinations of A(n) and B(n) pins - repeatable there also.

    The comments at


    imply multiple pins may be used.

      "VERSION": "2v04",
      "GIT_COMMIT": "3956264e",
      "FLASH": 524288, "RAM": 131072,

    Low priority (for me anyway) solution required as I am getting by with


    3 Attachments

    • A0at100Hz10msec.jpg
    • A5at1Hz100msec.jpg
    • A0at100Hz10msecA5at1Hz100msec.jpg

Avatar for Robin @Robin started