Arduino 1.0 update, access to integer values, inlines #2

Merged
merged 3 commits into from Mar 25, 2013

Projects

None yet

4 participants

@ringerc
Contributor
ringerc commented Jan 15, 2012

Hi

I've tweaked your DHT-22 library to fit my purposes, and thought the changes might be useful. Feel free to grab what you want.

I had to alter it to get it to build with the Arduino IDE 1.0 environment. Additionally, I wanted access to the integer values and wanted to avoid the need to use floating point, so I changed the class to store the original short ints from the sensor, corrected for the strange negative format used. The float accessors do the conversion on demand.

I've made the integer and float accessors available as inlines; the integer accessor in particular will inline to smaller than the function call would've, as well as being faster.

Your sensor library works much more reliably than the interrupt-driven hack I wrote before finding it, and doesn't consume any of those precious interrupt-capable pins either. Thanks very much for it.

@ktorn
ktorn commented Aug 5, 2012

The 1.0 update worked for me, thanks.

@nethoncho nethoncho merged commit 3d20fcd into nethoncho:master Mar 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment