I'm very new to Arduino (< 1 week) and have never programmed before, so apologies in advance.
Yesterday I set up the DHT11 sensor and I was able to get a reading in IDE, which was great. RH of 59% and temperature of 21 Celsius. Fantastic, it worked! I then tried to get this reading on a 16x2 LCD screen that came with the kit. It didn't work and I couldn't figure it out. At first I tried to fix this by changing out the resistor which didn't work. I decided to start from scratch and this worked. I could get a reading, but both RH and Temperature read as -999.
I tried to get a reading by going back to the original project, using the dht11 and Arduino only, the reading was still -999.
How can I tell if the sensor is working or if it's something in the code. I have uploaded the DHTlib to IDE. Code for both projects is below. I think I have included everything here, but please let me know if there's more information required.
I was assuming you were using the Adafruit library which requires a begin() method to set the pin as an input pin. I now see there are others. If that is not the case, please post the link to the DHT library you are using or state where you got it from.
Just had the same problem because I connected the output of the DHT22 on an analog Pin whereas it should be connected on a PWM pin.
In your case it seems that you connected your DHT on the pin 7 which is a digital one but not PWM (if you were using an UNO).
Try with the pins 3,5, 6, 9, 10, 11.