// // Created by camer on 16/05/2020. // #include "../../../include/DigitalDevices/DigitalActuators/DigitalActuatorRadiator.h" DigitalActuatorRadiator::DigitalActuatorRadiator(int temps, float thresholdHigh, float thresholdLow) : DigitalActuator(temps), thresholdHigh(thresholdHigh), thresholdLow(thresholdLow) {} 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); } } } float DigitalActuatorRadiator::getThresholdLow() const { return thresholdLow; } void DigitalActuatorRadiator::setThresholdLow(float thresholdLow) { DigitalActuatorRadiator::thresholdLow = thresholdLow; } float DigitalActuatorRadiator::getThresholdHigh() const { return thresholdHigh; } void DigitalActuatorRadiator::setThresholdHigh(float threshold) { DigitalActuatorRadiator::thresholdHigh = threshold; }