Using PWM and digitalInOut on the same Pin

16 Feb 2017

Hi!

How to use pwmOut and digitalInOut on the same pin? In Arduino it will be something like that:

pinMode(9, INPUT);

bool b = digitalRead(9);

pinMode(9, OUTPUT);

analogWrite(9, 127);

On MBED, pwm doesn't work in that case (i use STM32F0308-DISCO), even if just to create an object digitalInOut() with pwm pin

Here is the code https://developer.mbed.org/users/acos/code/Nucleo_pwm_withDIO/file/66e4c4d304b0/main.cpp