Hey everyone, Looking for the proper source code to display temp and humidity. I'm using the Audrino Mega 2650. I found a bunch for the Uno card, but not one for the mega card. I've attached a pic of my wiring and I'm also unsure if I have the proper 10k resistor for the dht11 sensor. Any and all help is appreciated. Been googling and searching youtube with no luck.
DHT libraries that support the UNO also support the MEGA. The library example sketches will do what you ask for.
Thank you, I'm getting close. I think it's just identifying the pin out for the display. I'm getting this error message... no matching function for call to 'LiquidCrystal::LiquidCrystal(int, int).
Can anybody take a peek at this and tell me what I'm doing wrong?
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(20, 21, 12,);
#define DHTTYPE DHT11
I'm a newbie too but I use the following.
#include <Wire.h> // include wire library
#include <hd44780.h> // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header
const int LCD_COLS = 20;
const int LCD_ROWS = 4;
hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip
void setup()
{
lcd.begin(20, 4);
lcd.init();
lcd.backlight();
}
You may have to change the COLs to 16 and ROWs to 2. Don't forget to download the library.
Hope this helps.
Tony
Thank you Tony!!!!! Is that all of the code? I see nothing for the sensor.
Try this...
The pin ("4" below) may change in your case. No sure what you plan on using.
#include <dht11.h>
#define DHT11PIN 4
dht11 DHT11;
void setup()
{
}
I've only used the DHT22 but found the above online. Give it a try. Remember to download the library before you try to compile.
j1mmi3b:
Thank you, I'm getting close. I think it's just identifying the pin out for the display. I'm getting this error message... no matching function for call to 'LiquidCrystal::LiquidCrystal(int, int).Can anybody take a peek at this and tell me what I'm doing wrong?
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(20, 21, 12,);
#define DHTTYPE DHT11
It certainly looks like a typo, with the comma after the 12.
You can get the code from Arduino displays temperature and humidity from DHT11 on LCD I2C , The tutorial uses Uno, but it works with Mega also. The wiring are the same
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.