I have an uno running a DHT11 was going to try it out so I loaded the Library from IDE manager and compiled but got an error on the Library so I went to the auto select type compiler ran it and got this error but don't see anything wrong..
expected primary-expression before '.' token.
help I have written c code before and have several successful Arduino IDE compiled programs but I can't figure this one out????
void loop()
{
Serial.println("\n");
int doit = DHT.read(DHTPIN);----- error is highlighted here
Serial.print("Read sensor: ");
switch (doit)
{
case DHTLIB_OK:
Serial.println("OK");
break;
case DHTLIB_ERROR_CHECKSUM:
Serial.println("Checksum error");
break;
case DHTLIB_ERROR_TIMEOUT:
Serial.println("Time out error");
break;
default:
Serial.println("Unknown error");
break;
}
DHT11 is a temp humidity sensor and there are several instances of Library codes for it but it seems that I have tangled the situation I used the later code and had to remove DHT11 from the primary expression but DHT turns read but doesn't pass the compiler check. Thinking I have put too much variability into the term DHT?
Sorry, Paul, about the gramer I'm not an English major by any means!
I pulled up the DHT Tester code and put it together and it worked fine. So there has to be something in the Adafruit library that I'm not doing right in the front of the code to define that variable so I'll work with the library code and see if I can get that to work with a few more definitions in the right places.