@Robin, works as expected... hover over PWM tags on pins A0 and A5 at https://www.espruino.com/WiFi#pinout : They both show - TIM2_CH1 = Timer 2 Channel 1 - and since this is SW analog (PWM), it's on the same timer AND same channel... It cannot be the same... because there is only one interrupt available, and the last setting wins! - The example you refer to was made for Original Espruino with an STM32 that has a DAC to produce the analog output. PWM is just 'faking' it and is only 'energy-wise over time' analog.
Ahhhh, . . . the ol' hover to reveal additional detail trick!
Thank you for pointing that out @allObjects.
Page 1 of the datasheet indicated up to 11 timers. A cursory view of the WiFi pins suggested that there were up to that many PWM pins available. (no I didn't actually count) I should have read on to page 40 that described the timer labels and the 'ah ha' light might have gone on.
Hoisted by my own petard!
Waaaaay back in the day there was a long discussion about this, IIRC. I remember discussing this behavior on the original espruino board not long after I got it...
I really wish the STM32 datasheets were a little easier to work with (I remember looking at it back then) where all the info you needed was in one document, with sections only present for the peripherals on that part, like Atmel's datasheets - the STM32 peripherals absolutely bury the ones on the AVRs, and they're not really more expensive or anything.
Needs to be verified with an oscilloscope
Found this example that suggests two pins of the same prefix should work
I originally thought this to be the number suffix when using setWatch(),
but after eliminating unnecessary code, found to be repeatable on other pins also.
Run a0() - See Orn D3 output
Run a5() - See Pur D7 output
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.
Low priority (for me anyway) solution required as I am getting by with