ADT7410 Temperature Sensor sample.

Dependencies:   mbed

About ADT7410

ADT7410 is a temperature sensor and can be controlled by using the I2C.

About sample program

This program outputs temperature data.
In order to run I2C communication with connecting GR-PEACH and the sensor, you will need to pull up.
Short jumper of GR-PEACH, leakage solder in two places of "PU" of the sensor base, or, add with the external resistor (10KΩ).

About wiring

SensorGR-PEACH
VDD3.3V
GNDGND
SCLD15
SDAD14

main.cpp

Committer:
1050186
Date:
2016-05-12
Revision:
0:6e109b79e249

File content as of revision 0:6e109b79e249:

#include "mbed.h"
#include "ADT7410.h"

ADT7410 sensor(I2C_SDA, I2C_SCL);
DigitalOut led1(LED1);

int main() {
    float temp;

    printf("Sensor start!\n");
    led1 = 1;
    while(1) {
        temp = sensor.temp_value();
        printf("Temperature = %2.2f\n",temp);  
        led1 = !led1;
        wait_ms(250);
    }
}