GithubHelp home page GithubHelp logo

adafruit_tmp007_library's Introduction

Adafruit TMP007 Infrared Thermopile Sensor Build Status

This is a library for the Adafruit TMP007 Infrared Thermopile Sensor

Pick one up today in the adafruit shop!

These displays use I2C to communicate, 2 pins are required to interface

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, check license.txt for more information.

All text above must be included in any redistribution

To install, use the Arduino Library Manager and search for "Adafruit TMP007 Library" and install the library.

adafruit_tmp007_library's People

Contributors

cameronbunce avatar evaherrada avatar hoffmannjan avatar ladyada avatar siddacious avatar tdicola avatar tyeth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

adafruit_tmp007_library's Issues

arduino ide 1.6.4 retrieves older version of this library

when i installed this today from within the library manager feature of arduino ide 1.6.4, it pulled in the version that depends on the Adafruit Unified Sensor, however the latest version of the library does not depend on the Unified Sensor library.

how do we go about updating the version the arduino ide points to?

TMP007 initialization needs software reset

Under some circumstances TMP007 POR appears to be ineffective and the initial read16() in begin() ends up being not acknowledged by the device.

Suggested fix: issue a soft reset, which is good practice anyway (no minimum wait time mentioned in datasheet?). Code below - verified with own hardware.

boolean Adafruit_TMP007::begin(uint16_t samplerate) {
	Wire.begin();

	write16(TMP007_REG_CONFIG, // the first read16() can fail if device isn't reset at first
		TMP007_CFG_RESET ); // trigger software reset
	write16(TMP007_REG_CONFIG, 
		TMP007_CFG_MODEON  | // Conversion ON (not power-down)
		TMP007_CFG_ALERTEN | // Makes ALERT pin controlled by the alert flag bit
		TMP007_CFG_TRANSC  | // Transient Correction Enable (enabling sensor voltage and object temperature output filtering)
		samplerate );
	write16(TMP007_REG_STATMASK, 
		TMP007_STAT_ALERTEN | // Alert Flag Enable : any enabled flag in Status register will activate !ALERT pin
		TMP007_STAT_CRTEN );  // Temperature Conversion Ready Enable : CRTF flag in Status register will activate ALRTF
	if(read16(TMP007_REG_DEVID) != TMP007_DEVID_VAL) 
		return false;
	return true;
}

The begin() method samplerate param is the wrong size

Adafruit_TMP007::begin() takes a uint8_t samplerate parameter (line 55 Adafruit_TMP007.h), and sets it by default to TMP007_CFG_16SAMPLE, which is 0x0800, and can't fit in 8-bits. This value is then OR'ed together with a few other bits to set the config flag. The intention is to set hires sampling by default, but because this value is truncated to 0 by the compiler (silently), it instead appears to put the chip in 1-sample-average 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.