Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: PCT2075_Hello Brushless_STM3_ESC_2019_10 Alternator2020_06
PCT2075 Class Reference
PCT2075 & LM75B class library / PCT2075 & LM75B クラスライブラリ More...
#include <PCT2075.h>
Inherits I2CTempSensor.
Public Member Functions | |
| PCT2075 (PinName i2c_sda, PinName i2c_scl, char i2c_address=DEFAULT_I2C_SLAVE_ADDRESS) | |
| Create a PCT2075 instance connected to specified I2C pins with specified address I2Cピンとスレーブアドレスを指定し,インスタンスを作成します | |
| PCT2075 (I2C &i2c_obj, char i2c_address=DEFAULT_I2C_SLAVE_ADDRESS) | |
| Create a PCT2075 instance with I2C instance and specified address I2Cオブジェクトとスレーブアドレスを指定し,インスタンスを作成します | |
| virtual | ~PCT2075 () |
| デストラクタ | |
| virtual float | read (void) |
| Read temperature / 温度の読み出し | |
| virtual | operator float (void) |
| Read temperature / 温度の読み出し | |
Private Types | |
| enum | command_reg |
LM75Bのレジスタ名とアドレス More... | |
Private Member Functions | |
| void | init (void) |
| 初期化 | |
| short | read16 (void) |
| 温度の読み出し | |
Detailed Description
PCT2075 & LM75B class library / PCT2075 & LM75B クラスライブラリ
Class library provides very simple interface to read sensor value クラスライブラリはセンサの値を読む非常にシンプルなインターフェースを提供します
Example / コード例:
#include "mbed.h" #include "PCT2075.h" // or #include "LM75B.h" PCT2075 temp_sensor( p28, p27 ); // or LM75B temp_sensor( p28, p27 ); int main() { while(1) { printf( "temp = %7.3f\r\n", (float)temp_sensor ); wait( 1 ); } }
Definition at line 46 of file PCT2075.h.
Constructor & Destructor Documentation
| PCT2075 | ( | PinName | i2c_sda, |
| PinName | i2c_scl, | ||
| char | i2c_address = DEFAULT_I2C_SLAVE_ADDRESS |
||
| ) |
Create a PCT2075 instance connected to specified I2C pins with specified address I2Cピンとスレーブアドレスを指定し,インスタンスを作成します
- Parameters:
-
i2c_sda I2C-bus SDA pin i2c_scl I2C-bus SCL pin i2c_address (option) I2C-bus slave address (default: 0x90)
Definition at line 4 of file PCT2075.cpp.
| PCT2075 | ( | I2C & | i2c_obj, |
| char | i2c_address = DEFAULT_I2C_SLAVE_ADDRESS |
||
| ) |
Create a PCT2075 instance with I2C instance and specified address I2Cオブジェクトとスレーブアドレスを指定し,インスタンスを作成します
- Parameters:
-
i2c_obj I2C object (instance) i2c_address (option) I2C-bus slave address (default: 0x90)
Definition at line 10 of file PCT2075.cpp.
| ~PCT2075 | ( | ) | [virtual] |
デストラクタ
Definition at line 16 of file PCT2075.cpp.
Member Function Documentation
| operator float | ( | void | ) | [virtual] |
Read temperature / 温度の読み出し
- Returns:
- To make the object returns the value / オブジェクトが読みだした値を返すようにしています
Implements I2CTempSensor.
Definition at line 27 of file PCT2075.cpp.
| float read | ( | void | ) | [virtual] |
Read temperature / 温度の読み出し
- Returns:
- Returns temperature in Celsius (float) / 摂氏温度を返します(float型)
Implements I2CTempSensor.
Definition at line 20 of file PCT2075.cpp.
Generated on Wed Jul 13 2022 08:50:39 by
1.7.2