DHT11 extensions does not work


#1

Hello

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"
#2

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:
b

Code
code


#3

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.


#4

UNO code

dht%203

Panda sprite code

dht%204

I really do not know why :frowning:


#5

Hi RulT

You have to pass a chain of characters for your sprite. Here is the magic trick:
2021-04-20%2010_46_36-Window


#6

Changed… and it fails to upload :sob:

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


#7

In Arduino IDE it works, but not with mBlock


#8

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


#9

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

dht%206

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 -


#10

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;)


#11

It is a elegoo kit

Elegoo UNO R3

Ultrasonic works fine.


#12

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;)


#13

nosense post


#14

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


#15

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.


#16

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


#17

I have found the path:

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

After that?


#18

Hi,

you don’t use the same extension as me because my directory is DHT and not DHT_sensor_library-1.4.1
2021-04-20%2015_57_41-build

Look in the CODE.D if the path is correct.
Trouv%C3%A9

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


#19

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…


#20

Hi
Look, I have all this:
dht%209