Main Site Documentation

Pwm on wrong pin?


#1

Hello all,

#include “mbed.h”

PwmOut t5(p5);

int main() {
t5.period_ms(10);
t5.pulsewidth_ms(1);
while(1) {
}
}

Using my scope I see the desired pwm trace on p9. Other pins are high.

I’m confused. What am I doing wrong?

:-[

Eric


#2

With mBuino, P0.5 in not a PWM pin. P0.9 is a PWM pin.


#3

Mike

Thanks. I did not notice that the pin # in the board were p0.x now it makes sense. Got two pwm traces going (but the periods are the same which is a limit of this board / chipset I think.

Eric