Hello world code for PCT2075 and LM75B component class library. 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.
Diff: PCT2075/PCT2075.h
- Revision:
- 1:5398b0799e20
- Parent:
- 0:3c3d4c5ac8e9
--- a/PCT2075/PCT2075.h Fri Feb 27 10:47:24 2015 +0000
+++ b/PCT2075/PCT2075.h Fri Feb 27 12:35:30 2015 +0000
@@ -14,6 +14,9 @@
* http://i2c_sda.nxp.com/documents/data_sheet/LM75B.pdf
*/
+#ifndef MBED_PCT2075_H
+#define MBED_PCT2075_H
+
#include "mbed.h"
#include "I2CTempSensor.h"
@@ -53,9 +56,9 @@
public:
/** I2Cピンとスレーブアドレスを指定し,インスタンスを作成します
*
- * @param i2c_sda I2C-bus i2c_sdaピン
- * @param i2c_scl I2C-bus i2c_sclピン
- * @param i2c_address (オプション) I2C-bus スレーブアドレス (デフォルト: 0x90)
+ * @param i2c_sda I2C-bus i2c_sdaピン
+ * @param i2c_scl I2C-bus i2c_sclピン
+ * @param i2c_address (オプション) I2C-bus スレーブアドレス (デフォルト: 0x90)
*/
PCT2075( PinName i2c_sda, PinName i2c_scl, char i2c_address = DEFAULT_I2C_SLAVE_ADDRESS );
@@ -74,21 +77,20 @@
*
* @return 摂氏温度を返します(float型)
*/
- float read( void );
+ virtual float read( void );
/** 温度の読み出し
*
* @return オブジェクトが読みだした値を返すようにしています
*/
- operator float( void );
+ virtual operator float( void );
private:
/** デフォルト・スレーブアドレス */
enum {
DEFAULT_I2C_SLAVE_ADDRESS = 0x90
};
+};
- I2C *i2c_p;
- I2C &i2c;
- char adr;
-};
+#endif // MBED_PCT2075_H
+