Hi, I’m using the mbed online compiler and trying to make the DHT 11 (Temp and Humidity Sensor) to work, as I compile the program I keep getting an error tha says “use of undeclared identifier Open Drain”
Yes here is the link, DHT11 - A library for the use of DHT11, a temperature and… | Mbed
can you share info about the board and MbedOS version what did you use? Because I did not encounter an error about “use of undeclared identifier Open Drain”.
Below are updated versions for MbedOS6+
DHT11 - Fork of https://os.mbed.com/users/s_inoue_mbed/co… | Mbed
DHT - Fork of DHT component - https://os.mbed.com/teams… | Mbed
These were not tested on real hardware for now so please let me know.
I am new to Mbed so I dont know if I did any mistakes on the code or I didn’t declare a variable, I will upload images of the errors I am getting. the board I am using is the FRDM K64F/
it seems it is not your fault, but your board not have supported (or implemented) OpenDrain PinMode.
For compare with another board:
- Your board - mbed-os/PinNames.h at 8a0c3c79157342f5d27ff259c12f04c7dd2ab4ad · ARMmbed/mbed-os · GitHub
- STM boads - mbed-os/PinNamesTypes.h at a3be10c976c36da222517abc0cb4f81e88ff8552 · ARMmbed/mbed-os · GitHub
Try to use the second library.
Do you mind guiding me through on how to add the second library?
Try to import this example - Seeed_Grove_Temp_Humidity_Example - Temp and Humidity sensor example. DHT11 | Mbed
Right click on mbed library in your project (gear wheel) and choose Update and change pin name in the constructor of the DHT object, if you needed.
You will see if it will work.