Erriez LM35 library for Arduino
1.1.0
This is a LM35 analog temperature sensor library for Arduino.
|
#include <ErriezLM35.h>
Public Member Functions | |
LM35 (uint8_t pin) | |
LM35 constructor. More... | |
uint16_t | readTemperature () |
Read unsigned analog temperature. More... | |
LM35 sensor class.
Definition at line 49 of file ErriezLM35.h.
|
explicit |
LM35 constructor.
The constructor changes the ADC to 1.1V internal ADC reference voltage for higher accuracy. This affects all ANALOG pins.
pin | LM35 analog pin. |
Definition at line 42 of file ErriezLM35.cpp.
uint16_t LM35::readTemperature | ( | ) |
Read unsigned analog temperature.
Sample LM35 analog pin multiple times to find two identical samples to reduce noise. A maximum number of samples can be configured with macro LM35_MAX_SAMPLES. The last sampled temperature will be returned when no identical temperatures found.
Temperature range: 0.0 .. 110 degree Celsius: A negative temperature cannot be measured, because the ADC pin can only sample between positive 0.0 and 1.1 Volt.
Definition at line 75 of file ErriezLM35.cpp.