GithubHelp home page GithubHelp logo

adafruit / adafruit_tmp006 Goto Github PK

View Code? Open in Web Editor NEW
18.0 13.0 16.0 118 KB

This is a library for the Adafruit TMP006 Infrared Thermopile Sensor

Home Page: http://www.adafruit.com/products/1296

C++ 100.00%

adafruit_tmp006's People

Contributors

cameronbunce avatar caternuson avatar driverblock avatar evaherrada avatar ladyada avatar tdicola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_tmp006's Issues

Large integer truncation around begin()

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

Include this library in Energia as a standard library

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

Support Power Off Mode

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.