adafruit / adafruit_tmp006 Goto Github PK
View Code? Open in Web Editor NEWThis is a library for the Adafruit TMP006 Infrared Thermopile Sensor
Home Page: http://www.adafruit.com/products/1296
This is a library for the Adafruit TMP006 Infrared Thermopile Sensor
Home Page: http://www.adafruit.com/products/1296
Product is discontinued:
https://www.adafruit.com/product/1296
The Wire.requestFrom() is a complete I2C transmission on its own. The Wire.beginTransmission() and Wire.endTransmission() should not be used there, they are used when writing data, not when requesting data.
Hi,
Looking through the code, I noticed something:
line 65: in Adafruit_TMP006.h
boolean begin(uint8_t samplerate = TMP006_CFG_16SAMPLE); // by default go highres
where TMP006_CFG_16SAMPLE is defined on line 51 as:
#define TMP006_CFG_16SAMPLE 0x0800
I believe this is problematic because of the large integer truncation that is happening. samplerate
is defined as an 8bit unsigned integer: uint8_t samplerate
but TMP006_CFG_16SAMPLE
cannot fit into that size. The truncation will cause the default value in the begin
function to be 0x00
, ie, the same as TMP006_CFG_1SAMPLE
which isn't problematic, but isn't the intended function.
The fix is simple: change the samplerate
variable to be of type uint16_t
Can anyone confirm if this is a bug?
Thanks,
Robert
Hello Adafruit,
Don't have another way to contact you so doing it this way. I would love to include this library in Energia (http://energia.nu). I know it is open source and all but do want to ask your permission to keep things nice. I'll leave it as is so that the product page is in the Sketch and that it is named Adafruit_TMP006.
Thanks,
Robert@Energia
Would it be possible to support the power down mode?
Bits [14:12] MOD[2:0]: Mode of operation
000 = Power-down
111 = Sensor and ambient continuous conversion (MOD)
Initiating power-down has an immediate effect; it aborts the current conversion and puts the device into a low-power shutdown mode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.