Lot's of basic errors in all examples. I was there too when I started, hang in there and keep trying, you will get there some day.
First example
1. you never initialize the DHT class
at a minimum you need to add this line before setup (there may be other issues as well)
code should be (first dht is the class name, second DHT is the name you want to call your sensor):
dht DHT;
2, may be more errors, my attached code will compile
second example
1. you need to add the ; character after your dht DHT line
note: my library the class name is lower case dht,
2, may be more errors, my attached code will compile
third example
1. #include needs to be the name of the library in correct case try #include
2. my libraries require the sensor to be connected to a digital pin (A0 is an analog)
3. need #include
My attached code compiles, not sure it will work with your lcd and such
Lot's of basic errors in all examples. I was there too when I started, hang in there and keep trying, you will get there some day.First example1. you never initialize the DHT classat a minimum you need to add this line before setup (there may be other issues as well)code should be (first dht is the class name, second DHT is the name you want to call your sensor):dht DHT;2, may be more errors, my attached code will compilesecond example1. you need to add the ; character after your dht DHT linenote: my library the class name is lower case dht,2, may be more errors, my attached code will compilethird example1. #include needs to be the name of the library in correct case try #include 2. my libraries require the sensor to be connected to a digital pin (A0 is an analog)3. need #include My attached code compiles, not sure it will work with your lcd and such
การแปล กรุณารอสักครู่..
