DHT11 extensions does not work



I am trying to add DHT11 temperature and humidity extensions to mblock 5.0, but none of them works. I try to upload the block code to arduino UNO, but always fails. I have tried all that I have found.

Anu suggestions?

How to enable the block "Read Ultrasonic sensor trig pin/echo pin"

Hi RuIT,

I dropped the other POST and we will use it.
I don’t have the DHT11 sensor but the extension you are using does not work with me. The extension that UPLOAD is this:



It fails to upload

Command failed: avr-toolchain\bin\avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"C:\Users\Public\Programs\mblock\resources\app\mlink-v1\external\arduino\avr-library\variants\standard" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src" -I"arduino-libraries/makeblock/src/utility/avr" -I"avr-library/libraries/Wire/src/utility" -I"avr-library/libraries/Wire/src/" -I"avr-library/libraries/EEPROM/src/" -I"avr-library/libraries/SPI/src/" -I"avr-library/libraries/SoftwareSerial/src/" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/utility/" -I"arduino-libraries/arduino/Esplora/src/" -I"arduino-libraries/arduino/Firmata/" -I"arduino-libraries/arduino/Firmata/utility/" -I"arduino-libraries/arduino/Keyboard/src/" -I"arduino-libraries/arduino/Mouse/src/" -I"arduino-libraries/arduino/Robot_Control/src/" -I"arduino-libraries/arduino/Robot_Motor/src/" -I"arduino-libraries/arduino/RobotIRremote/src/" -I"arduino-libraries/arduino/Stepper/src/" “C:\Users\usuario\mblock-avr\temp\build\code.cpp” -o “C:\Users\usuario\mblock-avr\temp\build\code.o” C:\Users\usuario\mblock-avr\temp\build\code.cpp: In function ‘void setup()’: C:\Users\usuario\mblock-avr\temp\build\code.cpp:34:49: error: expected primary-expression before ‘(’ token broadcaster.broadcast(String(“dht”),String(dht.readTemperature();)); ^ C:\Users\usuario\mblock-avr\temp\build\code.cpp:34:71: error: expected ‘)’ before ‘;’ token broadcaster.broadcast(String(“dht”),String(dht.readTemperature();)); ^ C:\Users\usuario\mblock-avr\temp\build\code.cpp:34:72: error: expected primary-expression before ‘)’ token broadcaster.broadcast(String(“dht”),String(dht.readTemperature();)); ^

Failed to compile file code.cpp

arduino build failed.


UNO code


Panda sprite code


I really do not know why :frowning:


Hi RulT

You have to pass a chain of characters for your sprite. Here is the magic trick:


Changed… and it fails to upload :sob:

Command failed: avr-toolchain\bin\avr-gcc -w -Os -Wl,–gc-sections -mmcu=atmega328p -o…


In Arduino IDE it works, but not with mBlock


Hi RuIT,

24 deg. inside because if it’s outside I’m coming;)

Remove only the line: send upload nome message …

See if you can upload your code


Just set variable to temparature… and it does not upload.


Command failed: avr-toolchain\bin\avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -


heee … ok …

Me, I have an Arduino UNO and a Chinese clone and it works fine.
Do you have a photo of the card ???

It’s strange because the Ultrasonic works well. I think Makeblock should give us a hand;)


It is a elegoo kit

Elegoo UNO R3

Ultrasonic works fine.


Ok RuIT,

Are you ready to go to the depths of mBlock ???
Search your HD for CODE.O and go to the location you found.

  1. the CODE.CPP to check in your Arduino IDE
  2. The DHT directory should be present for the library
  3. The CODE.D file is the paths.

Finally, can it help … I ignore it;)


nosense post


I have the library DHT and in the zip file there is a CPP file.
It is what you need?


Hi RuIT,

What I am telling you is probably expert and I do not understand it all. What I understand is that Makeblock needs to create the code and compile it before uploading it to the robot. I only found the location of the files. What I need is in this directory:
C: \ Users \ Crackel \ mblock-avr \ temp \ build

Crackel is the name of your Windows user … then you have to do a ZIP and make it available.

However, Makeblock may have an easier solution.


Sure. Please, Makeblock set light in the darkness!!!


I have found the path:

C: \ Users \ RulT \ mblock-avr \ temp \ build

After that?



you don’t use the same extension as me because my directory is DHT and not DHT_sensor_library-1.4.1

Look in the CODE.D if the path is correct.

It’s starting to be nonsense … Makeblock might come and save us;)


Good morning.

I think I have both directories (I am at office now): DHT and DHT_sensor_library-1.4.1

I supposed it will need the newest…


Look, I have all this: