Online Mbed compiler, DHT11

Hello,

it seems it is not your fault, but your board not have supported (or implemented) OpenDrain PinMode.
For compare with another board:

Try to use the second library.

BR, Jan