温度センサLM61CIZから入力した電圧値を温度として出力します。
LM61CIZ.cpp@3:3635002dc1de, 2016-01-20 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Wed Jan 20 15:29:56 2016 +0000
- Revision:
- 3:3635002dc1de
- Parent:
- 0:8aeec297e67f
??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_Cookbook_SE | 0:8aeec297e67f | 1 | /** |
mbed_Cookbook_SE | 0:8aeec297e67f | 2 | * LM61CIZ Temperature sensor library |
mbed_Cookbook_SE | 0:8aeec297e67f | 3 | * |
mbed_Cookbook_SE | 0:8aeec297e67f | 4 | * @author Junichi Katsu |
mbed_Cookbook_SE | 0:8aeec297e67f | 5 | * @version 1.0 |
mbed_Cookbook_SE | 0:8aeec297e67f | 6 | * @date 02-April-2015 |
mbed_Cookbook_SE | 0:8aeec297e67f | 7 | * |
mbed_Cookbook_SE | 0:8aeec297e67f | 8 | */ |
mbed_Cookbook_SE | 0:8aeec297e67f | 9 | |
mbed_Cookbook_SE | 0:8aeec297e67f | 10 | #include "mbed.h" |
mbed_Cookbook_SE | 0:8aeec297e67f | 11 | #include "LM61CIZ.h" |
mbed_Cookbook_SE | 0:8aeec297e67f | 12 | |
mbed_Cookbook_SE | 0:8aeec297e67f | 13 | LM61CIZ::LM61CIZ(PinName ain) : _sensor(ain) |
mbed_Cookbook_SE | 0:8aeec297e67f | 14 | { |
mbed_Cookbook_SE | 0:8aeec297e67f | 15 | |
mbed_Cookbook_SE | 0:8aeec297e67f | 16 | } |
mbed_Cookbook_SE | 0:8aeec297e67f | 17 | |
mbed_Cookbook_SE | 0:8aeec297e67f | 18 | float LM61CIZ::getTemperature(void) |
mbed_Cookbook_SE | 0:8aeec297e67f | 19 | { |
mbed_Cookbook_SE | 0:8aeec297e67f | 20 | return( ( _sensor * 3.3 - 0.6) / 0.01); |
mbed_Cookbook_SE | 0:8aeec297e67f | 21 | } |