Bulme lib for temp sensor LM75B

Dependents:   mbed-os-example-wifi-ThingSpeak mbed_freeRTOS_send STM_Statemachine

Committer:
bulmecisco
Date:
Mon Mar 14 13:23:07 2016 +0000
Revision:
0:29546bb2c7dd
Bulme Lib for temp sensor LM75B;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bulmecisco 0:29546bb2c7dd 1 #ifndef LM75B_H
bulmecisco 0:29546bb2c7dd 2 #define LM75B_H
bulmecisco 0:29546bb2c7dd 3
bulmecisco 0:29546bb2c7dd 4 #include "mbed.h"
bulmecisco 0:29546bb2c7dd 5
bulmecisco 0:29546bb2c7dd 6 // LM75B Adresse
bulmecisco 0:29546bb2c7dd 7 #define LM75B_ADDR 0x90
bulmecisco 0:29546bb2c7dd 8
bulmecisco 0:29546bb2c7dd 9 // LM75B Register
bulmecisco 0:29546bb2c7dd 10 #define LM75B_CONF 0x01
bulmecisco 0:29546bb2c7dd 11 #define LM75B_TEMP 0x00
bulmecisco 0:29546bb2c7dd 12
bulmecisco 0:29546bb2c7dd 13 class LM75B
bulmecisco 0:29546bb2c7dd 14 {
bulmecisco 0:29546bb2c7dd 15 public:
bulmecisco 0:29546bb2c7dd 16 LM75B(PinName sda, PinName scl); // I2C Pins übergeben p28, p27
bulmecisco 0:29546bb2c7dd 17 ~LM75B();
bulmecisco 0:29546bb2c7dd 18 float read();
bulmecisco 0:29546bb2c7dd 19
bulmecisco 0:29546bb2c7dd 20 private:
bulmecisco 0:29546bb2c7dd 21 char cmd[2];
bulmecisco 0:29546bb2c7dd 22 I2C i2c;
bulmecisco 0:29546bb2c7dd 23 };
bulmecisco 0:29546bb2c7dd 24 #endif