Library for the LM75A Temperature Sensor
Dependents: LM75A_Test_Code MQTT_and_Temperature_Sensore_LM75 2021_Temp_y_Acelerom_V4enlace_serial
Diff: LM75A.cpp
- Revision:
- 1:19dc98c810a5
- Parent:
- 0:94c821cb7f80
diff -r 94c821cb7f80 -r 19dc98c810a5 LM75A.cpp --- a/LM75A.cpp Wed Jun 27 21:20:27 2012 +0000 +++ b/LM75A.cpp Fri Aug 15 11:56:39 2014 +0000 @@ -26,7 +26,7 @@ LM75A::LM75A(PinName sda, PinName scl, int addr) : m_i2c(sda, scl), m_addr(addr) { - + reg_addr = TEMP_REG_ADDR; } @@ -40,7 +40,7 @@ float LM75A::read_T() { - m_i2c.write(m_addr, TEMP_REG_ADDR, 1); // Pointer to the temperature register + m_i2c.write(m_addr, ®_addr, 1); // Pointer to the temperature register char cmd[2] = {0,0}; m_i2c.read(m_addr, cmd, 2); // read temperature register