Component class library for PCT2075 and LM75B. The PCT2075 is a temperature-to-digital converter featuring +/-1 degree-C accuracy over -25 degree-C to +100 degree-C range. It uses an on-chip band gap temperature sensor and Sigma-Delta A-to-D conversion technique with an overtemperature detection output that is a drop-in replacement for other LM75 series thermal sensors.
Dependents: PCT2075_Hello Brushless_STM3_ESC_2019_10 Alternator2020_06
Diff: PCT2075.cpp
- Revision:
- 0:ae0333775d7e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCT2075.cpp Thu Mar 05 06:11:06 2015 +0000 @@ -0,0 +1,30 @@ +#include "I2CTempSensor.h" +#include "PCT2075.h" + +PCT2075::PCT2075( PinName i2c_sda, PinName i2c_scl, char i2c_address ) + : I2CTempSensor( i2c_sda, i2c_scl, i2c_address ) +{ + init(); +} + +PCT2075::PCT2075( I2C &i2c_obj, char i2c_address ) + : I2CTempSensor( i2c_obj, i2c_address ) +{ + init(); +} + +PCT2075::~PCT2075() +{ +} + +float PCT2075::read( void ) +{ + typedef I2CTempSensor base; + + return( base::read16() / 256.0 ); +} + +PCT2075::operator float( void ) +{ + return( read() ); +}