E707 Basic NodeMCU-V2 Shield Library  1.0
Public Member Functions | Protected Attributes
_TempSensor Class Reference

Base class for any temperature sensor. More...

#include <basic-nodemcuv2-shield.h>

Inheritance diagram for _TempSensor:
LM35 LM36

Public Member Functions

float getTemperatureC (void)
 Function to read the temperature of a temp-sensor and return it in Celcius. More...
 
float getTemperatureF (void)
 Function to read the temperature of a temp-sensor and return it in Fahrenheit. More...
 

Protected Attributes

int offset
 The voltage offset in mV from the temperature sensor. More...
 
int divide_by
 The voltage division in mV from the temperature sensor. More...
 

Detailed Description

Base class for any temperature sensor.

Temp sensors call up this class and change the offset and divide_by variables. This should eliminate copy-and-paste code

Member Function Documentation

◆ getTemperatureC()

float _TempSensor::getTemperatureC ( void  )

Function to read the temperature of a temp-sensor and return it in Celcius.

Returns
The temperature in Celcius

◆ getTemperatureF()

float _TempSensor::getTemperatureF ( void  )

Function to read the temperature of a temp-sensor and return it in Fahrenheit.

Returns
The temperature in Fahrenheit

Field Documentation

◆ divide_by

int _TempSensor::divide_by
protected

The voltage division in mV from the temperature sensor.

This number is what the input voltage in mV is divided by after substracting offset.

◆ offset

int _TempSensor::offset
protected

The voltage offset in mV from the temperature sensor.

This number is substracted from the read analog input value (in mV) before dividing by divide_by.


The documentation for this class was generated from the following files: