From 5588c00033a0748e5eb793cec5632b7484687376 Mon Sep 17 00:00:00 2001 From: MoysieWRX Date: Sat, 30 May 2015 22:36:40 +0300 Subject: [PATCH] Updated for Cooling Fan controls Updated for Cooling Fan controls --- auxiliaries.ino | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 auxiliaries.ino diff --git a/auxiliaries.ino b/auxiliaries.ino new file mode 100644 index 00000000..34756865 --- /dev/null +++ b/auxiliaries.ino @@ -0,0 +1,22 @@ +/* +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 +*/ + +/* +These functions control the auxillary outputs +*/ + +void initialiseFan() +{ +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 +} + +void FanControl() +{ + if (currentStatus.coolant >= (configPage4.FanSP - CALIBRATION_TEMPERATURE_OFFSET)) {digitalWrite(pinFan,FanHIGH);} + else if (currentStatus.coolant <= (configPage4.FanSP - configPage4.FanHyster)){ digitalWrite(pinFan, FanLOW);} +}