Hi,
While we are on the subject of LEDs, are LEDs1-4 independent of the PWMOUTs or do I "burn" a PWMOUT when I program an LED to be used?
You only burn a PwmOut if you are using a LED as a PwmOut. If you are using it as a DigitalOut, no impact.
Details:
There are 6 physical PWM blocks on the mbed, so you can have up to 6 PwmOut objects. Whilst these will generally be routed out to pins 21-26, 4 can alternatively be routed to the LEDs. Here are the mappings:
p21 = P2_5 = PWM_6
p22 = P2_4 = PWM_5
p23 = P2_3 = PWM_4
p24 = P2_2 = PWM_3
p25 = P2_1 = PWM_2
p26 = P2_0 = PWM_1
LED1 = P1_18 = PWM_1
LED2 = P1_20 = PWM_2
LED3 = P1_21 = PWM_3
LED4 = P1_23 = PWM_4
So you can see, LED1 and p26 share the same physical PWM hardware channel, so you can use either LED1 or p26 as a PwmOut (using PWM_1 hardware), but obviously not both at the same time.
Simon