SPI 接続の温度センサ ADT7310 用のライブラリ. Library for temperature sensor ADT7310 connected using SPI interface.
Diff: ADT7310.cpp
- Revision:
- 1:38a276440674
- Parent:
- 0:6890e1214ea6
--- a/ADT7310.cpp Sat Jun 27 08:09:59 2015 +0000 +++ b/ADT7310.cpp Sat Oct 28 14:51:32 2017 +0000 @@ -1,7 +1,7 @@ //-------------------------------------------------------------- -// Class for using ADT7310 on one-shot mode +// Class for ADT7310 on one-shot mode // Default: 13-bit resolution -// 2015/06/27, Copyright (c) 2015 MIKAMI, Naoki +// 2017/10/28, Copyright (c) 2017 MIKAMI, Naoki //-------------------------------------------------------------- #include "ADT7310.hpp" @@ -15,7 +15,7 @@ { Reset(); spi_.format(8, 3); // mode: 8 bits, POL = 1, PHA = 1 - SetConfigReg(0x00); // Set 13-bit resolution + SetConfigReg(0x00); // Clear configuration register. } // Software reset @@ -66,8 +66,9 @@ Deselect(); uint8_t config = GetConfigReg() & 0x80; - SetConfigReg(0x20 | config); // Start conversion + SetConfigReg(0x20 | config); // One-shot mode, Start conversion return data/128.0f; } } +