[Temperature] TMP102 Sensor Library

The TMP102 is a low power digital temperature sensor with I2C interface. This is a library (for arduino or cpp) that gives a simple interface with the TMP102 module. You...

The TMP102 is a low power digital temperature sensor with I2C interface. This is a library (for arduino or cpp) that gives a simple interface with the TMP102 module. You can easily read the temperature with the arduino just by requesting a single line. This keeps your sketches easy. Downloads and example usage is below.

Download

Example

This code is also included in the .zip and you can request it generally with the example from the menu in the arduino IDE.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <Wire.h>
#include <TMP102.h>
 
void setup()
{
  Serial.begin(9600);
  TMP102.init();
}
 
void loop()
{
  int t;
  delay(100); // There will be new values every 100ms
  TMP102.getValues(&t);
  Serial.print("Temperature: ");
  Serial.println(t);
 
}

About Tim Zaman

There's page about myself with some babble and pics on this site Here!. // R&D : Vision/Imaging | 2D/3D Image Processing | Robotics/Automation | Programming | Electronics | Open Source | And, obviously, Photography.

Creative Commons License
The [Temperature] TMP102 Sensor Library by Tim Zaman, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 3.0 Unported License.