digital1o1 / dht_22-temperature-humidty-oled-display Goto Github PK
View Code? Open in Web Editor NEWDisplaying both humidity and temperature from a DHT_22 sensor on two 1.5 OLED Displays using I2C to communicate to an Arduino/AVR board
Displaying both humidity and temperature from a DHT_22 sensor on two 1.5 OLED Displays using I2C to communicate to an Arduino/AVR board
Hello, first I would like to say THANK YOU! for making this code. Long story short my father has been using a smoker for various cured meats they make at home and I wanted to make a simple dual screen monitoring system for him that shows Humidity on one screen and Temp on the other screen. I am not super good with code but I found your src code. I cant seem to compile it though (Im using a Arduino Nano btw). When I first tried to upload it I have a issue with the dht.h library referenced at the top. I fixed that by making it DHT.h Next it hangs on current_humditiy = DHT.humidity; with error
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\Blue_\Documents\Arduino\libraries\U8g2\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Users\Blue_\Documents\Arduino\libraries\DHT_sensor_library" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Users\Blue_\Documents\Arduino\libraries\Adafruit_Unified_Sensor" "C:\Users\Blue_\AppData\Local\Temp\arduino_build_850923\sketch\Dual_Screen_U8g2_custom.ino.cpp" -o "C:\Users\Blue_\AppData\Local\Temp\arduino_build_850923\sketch\Dual_Screen_U8g2_custom.ino.cpp.o"
C:\Users\Blue_\Documents\Arduino\Temprature_and_Humidity_Station\Dual_Screen_U8g2_custom\Dual_Screen_U8g2_custom.ino: In function 'void get_Current_Readings()':
Dual_Screen_U8g2_custom:19:18: error: expected primary-expression before '.' token
int chk = DHT.read22(DHT22_2);
^
Dual_Screen_U8g2_custom:19:26: error: 'DHT22_2' was not declared in this scope
int chk = DHT.read22(DHT22_2);
^~~~~~~
C:\Users\Blue_\Documents\Arduino\Temprature_and_Humidity_Station\Dual_Screen_U8g2_custom\Dual_Screen_U8g2_custom.ino:19:26: note: suggested alternative: 'DHT22'
int chk = DHT.read22(DHT22_2);
^~~~~~~
DHT22
Dual_Screen_U8g2_custom:20:23: error: expected primary-expression before '.' token
current_temp = DHT.temperature;
^
Dual_Screen_U8g2_custom:21:27: error: expected primary-expression before '.' token
current_humditiy = DHT.humidity;
^
Using library U8g2 at version 2.27.6 in folder: C:\Users\Blue_\Documents\Arduino\libraries\U8g2
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
Using library DHT_sensor_library at version 1.4.1 in folder: C:\Users\Blue_\Documents\Arduino\libraries\DHT_sensor_library
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Using library Adafruit_Unified_Sensor at version 1.1.4 in folder: C:\Users\Blue_\Documents\Arduino\libraries\Adafruit_Unified_Sensor
exit status 1
expected primary-expression before '.' token
This seems like simple code so I assumed maybe my libraries are different. I deleted the DHT library and so on then reinstalled them but same issues. Please helps as I wanted this done tonight but I assume you wont see this in time. I wanted to go by there tomorrow and have it ready for him.
If you do end up reading this please let me know what you think I should fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.