CANT GET MY LCD TO WORK

I recently got my Arduino and other parts. Ive successfully used the uno rev 3 to send messages directly to my i2c lcd screen. But when I use my dht22 I cant get a screen readout. Ive used thousands of codes and different libraries but nothing seems to work. I did get the dht22 working on the serial monitor so I know its wired and works correctly. I know my lcd address is 0x3f,2,1,0,4,5,6,7,3,POSITIVE but I still cant get it to work. Ultimately I want my dht22 to turn on a fan once it gets to 60% humidity or 75 degrees F. But my first step is getting a proper readout on the lcd screen from the sensor. I can get a sketch to work fine but again nothing happens. Can someone give me the correct example of code and also which libraries to use exactly? THANKS IN ADVANCE!!

TuffyTuesday:
which libraries to use exactly?

Surely the fact that the LCD works to display stuff in sketch "A" and the dht works to the serial monitor in sketch "B" means that you have the correct libraries?

A statement like this...

I can get a sketch to work fine but again nothing happens.

... makes no sense, since nothing happening is pretty much the opposite of working fine.

Of the "thousands of codes" you've tried, perhaps post one here so others can have a look and try to help.

Edit: Your subject line is misleading. It does work, you said so here:

Ive successfully used the uno rev 3 to send messages directly to my i2c lcd screen.

FWIW the code below works with my I2C LCD and a DHT11 (I don’t have a 22):

// dht11 to i2c lcd
// http://forum.arduino.cc/index.php?topic=465642
// although that's for a dht22
//
#include <dht11.h>
dht11 DHT;
#define DHT11_PIN 5

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  lcd.begin();
  lcd.backlight();
  lcd.print("DHT11 test");
  delay(2000);
  lcd.clear();
}

void loop() {
  DHT.read(DHT11_PIN);    // READ DATA

  lcd.setCursor(0, 0); //along, down
  lcd.print("Temperature:");
  lcd.print(DHT.temperature);
  lcd.print((char)223);
  lcd.print("C");
  lcd.setCursor(0, 1); //along, down
  lcd.print("Humidity:   ");
  lcd.print(DHT.humidity);

  delay(1000);
}

ardy_guy:
FWIW the code below works with my I2C LCD and a DHT11 (I don't have a 22):

You were lucky. That library hard codes the PCF8574 to hd44780 pin mappings.
Your backpack happened to match those hard coded pin mappings.
If the pin mappings in that library don't match the way your backpacks is wired, it won't work.

TuffyTuesday:
I recently got my Arduino and other parts. Ive successfully used the uno rev 3 to send messages directly to my i2c lcd screen.

Well, as ardy_guy said earlier, that means it is working which disagrees with your other comment of:

I know my lcd address is 0x3f,2,1,0,4,5,6,7,3,POSITIVE but I still cant get it to work.

BTW, "0x3f,2,1,0,4,5,6,7,3,POSITIVE" is not an i2c address.
The 0x3f is an address, the other values are constructor parameters used to configure the pin mappings in the library.

Ultimately I want my dht22 to turn on a fan once it gets to 60% humidity or 75 degrees F.

The dht22 cannot turn on a fan, the Arduino will have to monitor the dht22 and then use a pin to active some external h/w that can turn on the fan.
If this external h/w is not properly isolated and powered, it can cause power issues for the Arduino and the LCD when the fan is turned on and off.

I think you need to clarify how things are wired up and what is working and what is not.

--- bill

bperrybap:
You were lucky.

I recall having to track down one that worked, in fact.

ardy_guy:
I recall having to track down one that worked, in fact.

You could use my hd44780 library package which should work with any backpack.
It will auto locate the backpack i2c address, and auto detect the pin mappings and backlight active level.
It can be installed directly from the IDE library manager.
You can read more about it here: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
The i/o class for PCF8574 based backpacks is hd44780_I2Cexp.
I would recommend first running the included diagnostic sketch (I2CexpDiag) to verify that the library is properly talking to the backpack. It will test the i2c signals and then test the memory inside the LCD module.

--- bill