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
Committer:
1050186
Date:
Thu May 12 10:16:22 2016 +0000
Revision:
0:6e109b79e249
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
1050186 0:6e109b79e249 1 #include "mbed.h"
1050186 0:6e109b79e249 2 #include "ADT7410.h"
1050186 0:6e109b79e249 3
1050186 0:6e109b79e249 4 ADT7410 sensor(I2C_SDA, I2C_SCL);
1050186 0:6e109b79e249 5 DigitalOut led1(LED1);
1050186 0:6e109b79e249 6
1050186 0:6e109b79e249 7 int main() {
1050186 0:6e109b79e249 8 float temp;
1050186 0:6e109b79e249 9
1050186 0:6e109b79e249 10 printf("Sensor start!\n");
1050186 0:6e109b79e249 11 led1 = 1;
1050186 0:6e109b79e249 12 while(1) {
1050186 0:6e109b79e249 13 temp = sensor.temp_value();
1050186 0:6e109b79e249 14 printf("Temperature = %2.2f\n",temp);
1050186 0:6e109b79e249 15 led1 = !led1;
1050186 0:6e109b79e249 16 wait_ms(250);
1050186 0:6e109b79e249 17 }
1050186 0:6e109b79e249 18 }