winlinvip / SimpleDHT

Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht
MIT License
144 stars 61 forks source link

this is probably not an issue... #7

Closed jackfruh closed 7 years ago

jackfruh commented 7 years ago

I'm using Arduino IDE 1.8.3 on osx.

The static values aren't working I get an error

DHT11:26: error: 'SimpleDHT' has not been declared
   int err = SimpleDHT::ErrSuccess; 
             ^
DHT11:27: error: 'SimpleDHT' has not been declared

I'm assuming this is more an issue of my compiler than the code? If so any idea how to fix or what I'd search the net for? (I know I can hack it by substituting 0 for SimpleDHT::ErrSuccess, just wondering how to fix that the static class member's not being seen.)

jackfruh commented 7 years ago

Digging in a little deeper, it looks like version 1.0.2 did not have the statics. When I looked at the zip file on my machine, it was the 1.0.2 version

1.0.2 is the highest version shown in the Arduino IDE's Library Manager.

Doing a bit of research it seems the library.properties file may need to be updated for this to show up in Arduino IDE Library Manager. I put in a pull request for this.

(Note I am new to this, doing the best I can to find the cause/fix, but I may be way off)

bgiesbrecht commented 7 years ago

Hi @jackfruh, you can download the latest version from GitHub and manually install it. I just did this myself yesterday. If you run into issues or have any questions, shout. I like this newer version better due to the error codes.

Just in case you need the docs for this: https://www.arduino.cc/en/Guide/Libraries#toc5.

jackfruhecolab commented 7 years ago

Thanks bgiesbrecht! I did that and it got me a little closer! (getting some sensor checksum errors, ordered new sensors to see if that fixes the issue)

winlinvip commented 7 years ago

Maybe I shouldn't use the static field of class, maybe macro is ok.

winlinvip commented 7 years ago

I've fixed it, please test it.

winlinvip commented 7 years ago

For 1.0.4, please test:

  1. Whether it fixed the build failed bug?
  2. Whether it works for DHT22?