Added missing getter

This commit is contained in:
Gunnar Skjold
2020-08-28 17:55:07 +02:00
parent 5d47105951
commit 859220d33f
2 changed files with 15 additions and 4 deletions

View File

@@ -16,6 +16,17 @@ void HwTools::setTempSensorPin(int tempSensorPin) {
}
}
void HwTools::setTempAnalogSensorPin(int tempAnalogSensorPin) {
if(tempAnalogSensorPin != this->tempAnalogSensorPin) {
if(tempAnalogSensorPin > 0 && tempAnalogSensorPin < 40) {
this->tempAnalogSensorPin = tempAnalogSensorPin;
pinMode(tempAnalogSensorPin, INPUT);
} else {
this->tempAnalogSensorPin = 0xFF;
}
}
}
void HwTools::setVccPin(int vccPin) {
if(vccPin > 0 && vccPin < 40) {
pinMode(vccPin, INPUT);

View File

@@ -39,7 +39,7 @@ public:
TempSensorData* getTempSensorData(uint8_t i);
bool updateTemperatures();
double getTemperature();
double getTemperature();
double getTemperatureAnalog();
double getTemperature(uint8_t address[8]);
int getWifiRssi();
void setLed(uint8_t ledPin, bool ledInverted);
@@ -50,9 +50,9 @@ public:
HwTools() {};
private:
uint8_t tempSensorPin = -1, tempAnalogSensorPin = -1;
uint8_t vccPin = -1;
uint8_t ledPin = -1, ledPinRed = -1, ledPinGreen = -1, ledPinBlue = -1;
uint8_t tempSensorPin = 0xFF, tempAnalogSensorPin = 0xFF;
uint8_t vccPin = 0xFF;
uint8_t ledPin = 0xFF, ledPinRed = 0xFF, ledPinGreen = 0xFF, ledPinBlue = 0xFF;
bool ledInverted, ledRgbInverted;
double vccOffset = 0.0;
double vccMultiplier = 1.0;