A class library development test using TMP102 (I2C temperature sensor).

test_TMP102.h

Committer:
yasubumi
Date:
2017-11-25
Revision:
0:89475bc39c8b
Child:
1:c9c43b132ed7

File content as of revision 0:89475bc39c8b:

#include "mbed.h"

// TMP102 I2C slave address(ADD0 connected to GND)
#define ADDR_TMP102     0x90

// TMP102 registers
#define TMP102_Temp     0x00
#define TMP102_Conf     0x01
#define TMP102_Tlow     0x02
#define TMP102_Thigh    0x03

class test_TMP102
{
public:
    test_TMP102(PinName sda, PinName scl);
    ~test_TMP102();
    void init(void);
    float read(void);
private:
    I2C i2c;
};