24 lines
678 B
C++
24 lines
678 B
C++
//
|
|
// Created by camer on 16/05/2020.
|
|
//
|
|
|
|
#include "../../../include/DigitalDevices/DigitalActuators/DigitalActuatorRadiator.h"
|
|
|
|
DigitalActuatorRadiator::DigitalActuatorRadiator(int temps, float threshold) : DigitalActuator(temps),
|
|
threshold(threshold) {}
|
|
|
|
void DigitalActuatorRadiator::activate() {
|
|
DigitalDevice::state = HIGH;
|
|
}
|
|
|
|
void DigitalActuatorRadiator::Run() {
|
|
int previousState = LOW;
|
|
while (1){
|
|
state = *ptrmem;
|
|
if ((state != previousState)||(state == HIGH)){
|
|
AnalogSensorTemperature::setAlea(1);
|
|
} else if((state != previousState)||(state == LOW)) {
|
|
AnalogSensorTemperature::setAlea(-1);
|
|
}
|
|
}
|
|
}
|