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.
Fork of TempSensor by
LinearTempSensor Class Reference
Linear Temperature Sensor class. More...
#include <LinearTempSensor.h>
Public Types | |
| enum | SensorType { MCP9700, MCP9701, LM35 } |
Sensor Type Definitions. More... | |
Public Member Functions | |
| LinearTempSensor (PinName ain, int N=10, SensorType type=MCP9700) | |
| Create a Temperature Sensor instanse. | |
| float | Sense () |
| Sample (read) sensor data and store to buffer. | |
| float | GetAverageTemp () |
| Calculate average temperature from sample buffer. | |
| float | GetLatestTemp () |
| Calculate temperature from the latest sample. | |
Detailed Description
Linear Temperature Sensor class.
Sample and store sensor acuired value in N (default=10) times and calculate avarage temperature from sampled data Supports Microchip MCP9700/9701, National Semiconductor LM35
Definition at line 18 of file LinearTempSensor.h.
Member Enumeration Documentation
| enum SensorType |
Sensor Type Definitions.
- Enumerator:
MCP9700 Microchip MCP9700 (Default)
MCP9701 Microchip MCP9701.
LM35 National Semiconductor LM35.
Definition at line 21 of file LinearTempSensor.h.
Constructor & Destructor Documentation
| LinearTempSensor | ( | PinName | ain, |
| int | N = 10, |
||
| SensorType | type = MCP9700 |
||
| ) |
Create a Temperature Sensor instanse.
- Parameters:
-
ain PinName of analog input N Number of samples to calculate average temperature (default = 10) type Sensor type (default = MCP9700)
Definition at line 9 of file LinearTempSensor.cpp.
Member Function Documentation
| float GetAverageTemp | ( | ) |
Calculate average temperature from sample buffer.
- Parameters:
-
None
- Returns:
- Average temperature from N times of sumple (Centigrade)
Definition at line 65 of file LinearTempSensor.cpp.
| float GetLatestTemp | ( | ) |
Calculate temperature from the latest sample.
- Parameters:
-
None
- Returns:
- Temperature from the latest sampled data (Centigrade)
Definition at line 90 of file LinearTempSensor.cpp.
| float Sense | ( | ) |
Sample (read) sensor data and store to buffer.
- Parameters:
-
None
- Returns:
- Sensor-acuired value (mV)
Definition at line 46 of file LinearTempSensor.cpp.
Generated on Wed Jul 13 2022 17:10:05 by
1.7.2
