2015-05-30 12:36:40 -07:00
|
|
|
/*
|
|
|
|
Speeduino - Simple engine management for the Arduino Mega 2560 platform
|
|
|
|
Copyright (C) Josh Stewart
|
|
|
|
A full copy of the license may be found in the projects root directory
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2015-08-20 06:21:27 -07:00
|
|
|
Fan control
|
2015-05-30 12:36:40 -07:00
|
|
|
*/
|
|
|
|
void initialiseFan()
|
|
|
|
{
|
2015-06-02 05:56:18 -07:00
|
|
|
if(configPage4.fanInv == 1) {fanHIGH = LOW, fanLOW = HIGH; }
|
|
|
|
else {fanHIGH = HIGH, fanLOW = LOW;}
|
|
|
|
digitalWrite(pinFan, fanLOW); //Initiallise program with the fan in the off state
|
2015-05-30 12:36:40 -07:00
|
|
|
}
|
|
|
|
|
2015-06-02 05:56:18 -07:00
|
|
|
void fanControl()
|
2015-05-30 12:36:40 -07:00
|
|
|
{
|
2015-06-02 05:56:18 -07:00
|
|
|
if (currentStatus.coolant >= (configPage4.fanSP - CALIBRATION_TEMPERATURE_OFFSET)) { digitalWrite(pinFan,fanHIGH); }
|
|
|
|
else if (currentStatus.coolant <= (configPage4.fanSP - configPage4.fanHyster)) { digitalWrite(pinFan, fanLOW); }
|
2015-05-30 12:36:40 -07:00
|
|
|
}
|
2015-08-20 06:21:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|