Compiling Help please

#include "OneWire.h"
#include "DallasTemperature.h"
// Define to which pin of the Arduino the 1-Wire bus is connected:
#define ONE_WIRE_BUS 9
#include <math.h>
#include <Adafruit_BMP085.h>
#define seaLevelPressure_hPa 1013.25

Adafruit_BMP085 bmp;


// Steinhart-Hart parameters
#define THERMISTORNOMINAL 10000
#define TEMPERATURENOMINAL 25
#define BCOEFFICIENT 3950
#define SERIESRESISTOR 10000

// Analog pins for the thermistors
const int THERMISTOR_PIN_1 = A0;
const int THERMISTOR_PIN_2 = A1;
const int THERMISTOR_PIN_3 = A2;
const int THERMISTOR_PIN_4 = A3;



// Create a new instance of the oneWire class to communicate with any OneWire device:
OneWire oneWire(ONE_WIRE_BUS);

// Pass the oneWire reference to DallasTemperature library:
DallasTemperature sensors(&oneWire);



int ledpin = 13; // initialize pin 13
int inpin = 7; // initialize pin 7
int val;// define val for Worm Barrel overflow sensor

const int PumpPin = 29;                    // for Worm Barrel pump

const int     WBMotor1Pin  = 22;    // For Worm Barrel In put water valve
const int     WBMotor2Pin  = 23;
const int     WBEnablePin  = 24;

const byte WBSensorInterrupt = 0;  // 1 = pin 2; 0 = pin 3  // For Worm Barrel hall sensor
const byte WBSensorPin       = 2;

volatile byte WBPulseCount;
float WBCalibrationFactor = 4.5;

float         WBFlowRate;
unsigned int  WBFlowMilliLitres;
float         WBTotalMilliLitresA;
unsigned long WBTotalMilliLitresB;
unsigned long WBOldTime;

float WBTargetTemperature = 20.00 ;  // For Obstention temperature
float WBActualTemperature;


const int ChillStillHeadpin = 40;  // Input from BSC460 for Still Head
const int ChillThumper1pin = 41;   // Input from BSC460 For Inline Thumper 1
const int ChillThumper2pin = 42;  // Input from BSC460 for Inline Thumper 2


const int     Rectification1Motor1Pin  = 30;   // For Inline Thumper 1
const int     Rectification1Motor2Pin  = 31;
const int     Rectification1EnablePin  = 32;


const byte Rectification1SensorInterrupt = 1;  // 1 = pin 2; 0 = pin 3
const byte Rectification1SensorPin       = 5;  // For Inline Thumper 1 hall sensor

float         Rectification1FlowRate;
unsigned int  Rectification1FlowMilliLitres;
float         Rectification1TotalMilliLitresA;
unsigned long Rectification1TotalMilliLitresB;
unsigned long Rectification1OldTime;

volatile byte Rectification1PulseCount;
float Rectification1CalibrationFactor = 4.5;



const int     Rectification2Motor1Pin  = 46;    // For Inline Thumper 2
const int     Rectification2Motor2Pin  = 47;
const int     Rectification2EnablePin  = 48;


const byte Rectification2SensorInterrupt = 3;  // 1 = pin 2; 0 = pin 3
const byte Rectification2SensorPin       = 6; // For Inline Thumper 2 hall sensor

float         Rectification2FlowRate;
unsigned int  Rectification2FlowMilliLitres;
float         Rectification2TotalMilliLitresA;
unsigned long Rectification2TotalMilliLitresB;
unsigned long Rectification2OldTime;

volatile byte Rectification2PulseCount;
float Rectification2CalibrationFactor = 4.5;


const int     StillHeadMotor1Pin  = 30;
const int     StillHeadMotor2Pin  = 31;
const int     StillHeadEnablePin  = 32;


const byte StillHeadSensorInterrupt = 1;  // 1 = pin 2; 0 = pin 3
const byte StillHeadSensorPin       = 4;

float         StillHeadFlowRate;
unsigned int  StillHeadFlowMilliLitres;
float         StillHeadTotalMilliLitresA;
unsigned long StillHeadTotalMilliLitresB;
unsigned long StillHeadOldTime;

volatile byte StillHeadPulseCount;
float StillHeadCalibrationFactor = 4.5;


const int Gas = 50; // for gas Burner 2 to be turned off above 80c
const int Electric = 51; // for Electric Element 2 to be turned off above 80c


const float setPointGas = 80.0; // Set point in Celsius
boolean signalStateGas = true; // Initial state of the signal for gas

const float setPointElectric = 80.0; // Set point in Celsius
boolean signalStateElectric = true; // Initial state of the signal for gas

float getTemperature(int pin) {
  int rawADC = analogRead(pin);
  float resistance = SERIESRESISTOR / ((1023.0 / rawADC) - 1.0);

  float steinhart;
  steinhart = resistance / THERMISTORNOMINAL;
  steinhart = log(steinhart);
  steinhart /= BCOEFFICIENT;
  steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15);
  steinhart = 1.0 / steinhart;
  steinhart -= 273.15;

  return steinhart;





  void setup()

  {
    Serial.begin(9600);
    sensors.begin();
    if (!bmp.begin()) {
      Serial.println("Could not find a valid BMP085 sensor, check wiring!");
      while (1) {}
    }

    pinMode ( PumpPin, OUTPUT);
    digitalWrite ( PumpPin,  HIGH) ;

    pinMode ( Gas, OUTPUT);
    pinMode ( Electric, OUTPUT);

    digitalWrite ( Gas, HIGH);
    digitalWrite ( Electric, HIGH);

    pinMode          (WBMotor1Pin, OUTPUT);
    pinMode          (WBMotor2Pin, OUTPUT);
    pinMode          (WBEnablePin, OUTPUT);


    pinMode          (Rectification1Motor1Pin, OUTPUT);
    pinMode          (Rectification1Motor1Pin, OUTPUT);
    pinMode          (Rectification1EnablePin , OUTPUT);


    pinMode          (Rectification2Motor1Pin, OUTPUT);
    pinMode          (Rectification2Motor1Pin, OUTPUT);
    pinMode          (Rectification2EnablePin , OUTPUT);


    pinMode          (StillHeadMotor1Pin, OUTPUT);
    pinMode          (StillHeadMotor1Pin, OUTPUT);
    pinMode          (StillHeadEnablePin , OUTPUT);

    pinMode(ledpin, OUTPUT); // set LED pin as “output”
    pinMode(inpin, INPUT); // set button pin as “input”


    pinMode (ChillThumper1pin, INPUT); // Chill Thumper 1 from BSC460
    pinMode (ChillThumper2pin, INPUT); // Chill Thumper 2 from BSC460
    pinMode (ChillStillHeadpin, INPUT); // Chill Still Head from BSC460


    digitalWrite (ChillThumper1pin, LOW);   // Chill Thumper 1 from BSC460
    digitalWrite (ChillThumper2pin, LOW);   // Chill Thumper 2 from BSC460
    digitalWrite (ChillStillHeadpin, LOW);  // Chill Still Head from BSC460


  }



  void loop()

  {

    float temp1 = getTemperature(THERMISTOR_PIN_1); // Still body
    float temp2 = getTemperature(THERMISTOR_PIN_2); // Still head
    float temp3 = getTemperature(THERMISTOR_PIN_3); // Thumper 1
    float temp4 = getTemperature(THERMISTOR_PIN_4); // Thumper 2


    //  Serial.println(" ");
    //  Serial.print("Still Body: ");
    //  Serial.print(temp1);
    //  Serial.print(" *C ");

    //  Serial.print("Still Head: ");
    //  Serial.print(temp2);
    //  Serial.print(" *C ");

    //  Serial.print("Thumper 1: ");
    //  Serial.print(temp3);
    //  Serial.print(" *C ");

    //  Serial.print("Thumper 2: ");
    //  Serial.print(temp4);
    //  Serial.print(" *C ");
    //  Serial.print(" *C ");
    //  Serial.println(" ");

    // Serial.print("VAL ");
    // Serial.print (val);

    // Send the command for all devices on the bus to perform a temperature conversion:
    sensors.requestTemperatures();

    // Fetch the temperature in degrees Celsius for device index:
    float tempC = sensors.getTempCByIndex(0); // the index 0 refers to the first device
    // Fetch the temperature in degrees Fahrenheit for device index:
    float tempF = sensors.getTempFByIndex(0);


    WBActualTemperature = tempC ;
    {
      if ( temp1 >= 80 ) // Still Body temperature
      {
        signalStateGas = (false) ;
        signalStateElectric = (false) ;
      }

      {
        if ( signalStateGas == false)   // Turns false as still body temp comes above 80c turning off the second burner
          digitalWrite ( Gas, LOW);

        if ( signalStateElectric == false)   // Turns false as still body temp comes above 80c turning off the secong heater
          digitalWrite ( Electric, LOW);
      }
    }





    {
      // Worm Barrel Control///////////////////////////////////////////////////////////////////////
      ////////////////////////////////////////////////////////////////////////////////////////
      val = digitalRead(inpin); // read the level value of pin 7 and assign it to val
      {
        if (tempC >= 20.0 )
        {
          WBValveOpenControl() ;
        }
        else
        {
          WBValveCloseControl();
        }
      }
      {
        if (val == LOW)
        {
          WBValveOpenControl();
        }
        else
        {
          closeWBValve();
        }
      }
      { if (WBActualTemperature <= 16) digitalWrite (PumpPin,  LOW);
        else digitalWrite ( PumpPin , HIGH);
      }
    }
    ////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////


    {
      int ChillThumper1  = digitalRead(ChillThumper1pin );  // Read the pin state

      if (ChillThumper1 == HIGH) {  // If the button is pressed
        Rectification1ValveOpenControl(); Serial.print(" Open TK1 ");
      } else {  // If the button is not pressed
        Rectification1ValveCloseControl(); Serial.print(" close TK1 ");
      }


      int ChillThumper2  = digitalRead(ChillThumper2pin );  // Read the pin state

      if (ChillThumper2 == HIGH) {  // If the button is pressed
        Rectification2ValveOpenControl(); Serial.print(" Open TK2 ");
      } else {  // If the button is not pressed
        Rectification2ValveCloseControl(); Serial.print(" close TK2 ");
      }


      int ChillStillHead  = digitalRead(ChillStillHeadpin );  // Read the pin state

      if (ChillStillHead == HIGH) {  // If the button is pressed
        StillHeadValveOpenControl(); Serial.print(" Open SH ");
      } else {  // If the button is not pressed
        StillHeadValveCloseControl(); Serial.print(" close SH ");
      }


    }


    if ((millis() - WBOldTime) > 1000) {
      detachInterrupt(WBSensorInterrupt);

      WBFlowRate = ((1000.0 / (millis() - WBOldTime)) * WBPulseCount) / WBCalibrationFactor;

      WBOldTime = millis();

      WBFlowMilliLitres = (WBFlowRate / 60) * 1000;

      // Add the millilitres passed in this second to the cumulative total
      WBTotalMilliLitresA += WBFlowMilliLitres;
      WBTotalMilliLitresB += WBFlowMilliLitres;

      unsigned int WBFrac;

      WBFrac = (WBFlowRate - int(WBFlowRate)) * 10;
      // Reset the pulse counter so we can start incrementing again
      WBPulseCount = 0;

      // Enable the interrupt again now that we've finished sending output
      attachInterrupt(WBSensorInterrupt, WBPulseCounter, FALLING);

    }




    if ((millis() - Rectification1OldTime) > 1000)  {
      detachInterrupt(Rectification1SensorInterrupt);

      Rectification1FlowRate = ((1000.0 / (millis() - Rectification1OldTime)) * Rectification1PulseCount) / Rectification1CalibrationFactor;


      Rectification1OldTime = millis();

      Rectification1FlowMilliLitres = (Rectification1FlowRate / 60) * 1000;

      // Add the millilitres passed in this second to the cumulative total
      Rectification1TotalMilliLitresA += Rectification1FlowMilliLitres;
      Rectification1TotalMilliLitresB += Rectification1FlowMilliLitres;

      unsigned int Rectification1Frac;

      Rectification1Frac = (Rectification1FlowRate - int(Rectification1FlowRate)) * 10;
      // Reset the pulse counter so we can start incrementing again
      Rectification1PulseCount = 0;

      // Enable the interrupt again now that we've finished sending output
      attachInterrupt(Rectification1SensorInterrupt, Rectification1PulseCounter, FALLING);

    }







    if ((millis() - Rectification2OldTime) > 1000)  {
      detachInterrupt(Rectification2SensorInterrupt);

      Rectification2FlowRate = ((1000.0 / (millis() - Rectification2OldTime)) * Rectification2PulseCount) / Rectification2CalibrationFactor;


      Rectification2OldTime = millis();

      Rectification2FlowMilliLitres = (Rectification2FlowRate / 60) * 1000;

      // Add the millilitres passed in this second to the cumulative total
      Rectification2TotalMilliLitresA += Rectification2FlowMilliLitres;
      Rectification2TotalMilliLitresB += Rectification2FlowMilliLitres;

      unsigned int Rectification2Frac;

      Rectification2Frac = (Rectification2FlowRate - int(Rectification2FlowRate)) * 10;
      // Reset the pulse counter so we can start incrementing again
      Rectification2PulseCount = 0;

      // Enable the interrupt again now that we've finished sending output
      attachInterrupt(Rectification2SensorInterrupt, Rectification2PulseCounter, FALLING);

    }


    if ((millis() - StillHeadOldTime) > 1000)  {
      detachInterrupt(StillHeadSensorInterrupt);

      StillHeadFlowRate = ((1000.0 / (millis() - StillHeadOldTime)) * StillHeadPulseCount) / StillHeadCalibrationFactor;


      StillHeadOldTime = millis();

      StillHeadFlowMilliLitres = (StillHeadFlowRate / 60) * 1000;

      // Add the millilitres passed in this second to the cumulative total
      StillHeadTotalMilliLitresA += StillHeadFlowMilliLitres;
      StillHeadTotalMilliLitresB += StillHeadFlowMilliLitres;

      unsigned int StillHeadFrac;

      StillHeadFrac = (StillHeadFlowRate - int(StillHeadFlowRate)) * 10;
      // Reset the pulse counter so we can start incrementing again
      StillHeadPulseCount = 0;

      // Enable the interrupt again now that we've finished sending output
      attachInterrupt(StillHeadSensorInterrupt, StillHeadPulseCounter, FALLING);

    }

    {

      //  Serial.println();
      //  Serial.print( "Worm Barrel L ") ;
      //  Serial.print (WBTotalMilliLitresA);
      //  Serial.print ("  Still Head L ");
      //  Serial.print (StillHeadTotalMilliLitresA);
      //  Serial.print ("  Thumper 1 L ");
      //  Serial.print (Rectification1TotalMilliLitresA);
      //  Serial.print ("  Thumper 2 L ");
      //  Serial.print (Rectification2TotalMilliLitresA);
      // Serial.print("  Obstention Temperature: ");
      // Serial.print(tempC);
      // Serial.print(" \xC2\xB0"); // shows degree symbol
      // Serial.print("C  ");
      Serial.println();
      Serial.print("Ambient Temperature = ");
      Serial.print(bmp.readTemperature());
      Serial.println(" *C");

      Serial.print("Pressure = ");
      Serial.print(bmp.readPressure());
      Serial.println(" Pa");


      Serial.println();
    }
  }

  void WBPulseCounter() {

    // Increment the pulse counter
    WBPulseCount++;
  }

  void Rectification1PulseCounter() {

    // Increment the pulse counter
    Rectification1PulseCount++;
  }

  void Rectification2PulseCounter() {

    // Increment the pulse counter
    Rectification2PulseCount++;
  }

  void StillHeadPulseCounter() {

    // Increment the pulse counter
    StillHeadPulseCount++;
  }




  void openWBValve() {
    digitalWrite(WBEnablePin, HIGH);
    digitalWrite(WBMotor1Pin, LOW);
    digitalWrite(WBMotor2Pin, HIGH);
  }

  void closeWBValve() {
    digitalWrite(WBEnablePin, HIGH);
    digitalWrite(WBMotor1Pin, HIGH);
    digitalWrite(WBMotor2Pin, LOW);
  }

  void WBValveOpenControl() { // MLTFill Open valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(WBEnablePin, HIGH);
      digitalWrite(WBMotor1Pin, LOW);
      digitalWrite(WBMotor2Pin, HIGH);
      ////////////// A delay may be required here as the valve ages
      delay(100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(WBEnablePin, LOW);
      digitalWrite(WBMotor1Pin, LOW);
      digitalWrite(WBMotor2Pin, HIGH);
      SIpreviousMillis = SIcurrentMillis;
    }
  }

  void WBValveCloseControl() { // MLTFill Close valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(WBEnablePin, HIGH);
      digitalWrite(WBMotor1Pin, HIGH);
      digitalWrite(WBMotor2Pin, LOW);
      ////////////// A delay may be requireed as the valve ages
      delay (100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(WBEnablePin, LOW);
      digitalWrite(WBMotor1Pin, HIGH);
      digitalWrite(WBMotor2Pin, LOW);
      SIpreviousMillis = SIcurrentMillis;
    }
  }




  ///////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////
  /////////// Chill Thumper 1

  void openRectification1Valve() {
    digitalWrite(Rectification1EnablePin, HIGH);
    digitalWrite(Rectification1Motor1Pin, LOW);
    digitalWrite(Rectification1Motor2Pin, HIGH);
  }

  void closeRectification1Valve() {
    digitalWrite(Rectification1EnablePin, HIGH);
    digitalWrite(Rectification1Motor1Pin, HIGH);
    digitalWrite(Rectification1Motor2Pin, LOW);
  }


  void Rectification1ValveOpenControl() { // Rectification1 Open valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(Rectification1EnablePin, HIGH);
      digitalWrite(Rectification1Motor1Pin, LOW);
      digitalWrite(Rectification1Motor2Pin, HIGH);
      ////////////// A delay may be required here as the valve ages
      delay(100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(Rectification1EnablePin, LOW);
      digitalWrite(Rectification1Motor1Pin, LOW);
      digitalWrite(Rectification1Motor2Pin, HIGH);
      SIpreviousMillis = SIcurrentMillis;
    }
  }

  void Rectification1ValveCloseControl() { // Rectification1 Close valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(Rectification1EnablePin, HIGH);
      digitalWrite(Rectification1Motor1Pin, HIGH);
      digitalWrite(Rectification1Motor2Pin, LOW);
      ////////////// A delay may be requireed as the valve ages
      delay(100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(Rectification1EnablePin, LOW);
      digitalWrite(Rectification1Motor1Pin, LOW);
      digitalWrite(Rectification1Motor2Pin, HIGH);
      SIpreviousMillis = SIcurrentMillis;
    }
  }
  ////////////////////////////////////////////////////////////////////////////////
  /////////////////////////////////////////////////////////////////////////////////



  ////////////////////////////////////////////////////////////////////////////////////
  ////////////////////////////////////////////////////////////////////////////////////
  //Chill Thumper 2

  void openRectification2Valve() {
    digitalWrite(Rectification2EnablePin, HIGH);
    digitalWrite(Rectification2Motor1Pin, LOW);
    digitalWrite(Rectification2Motor2Pin, HIGH);
  }

  void closeRectification2Valve() {
    digitalWrite(Rectification2EnablePin, HIGH);
    digitalWrite(Rectification2Motor1Pin, HIGH);
    digitalWrite(Rectification2Motor2Pin, LOW);
  }


  void Rectification2ValveOpenControl() { // Rectification2 Open valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(Rectification2EnablePin, HIGH);
      digitalWrite(Rectification2Motor1Pin, LOW);
      digitalWrite(Rectification2Motor2Pin, HIGH);
      ////////////// A delay may be required here as the valve ages
      delay(100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(Rectification2EnablePin, LOW);
      digitalWrite(Rectification2Motor1Pin, LOW);
      digitalWrite(Rectification2Motor2Pin, HIGH);
      SIpreviousMillis = SIcurrentMillis;
    }
  }

  void Rectification2ValveCloseControl() { // Rectification2 Close valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(Rectification2EnablePin, HIGH);
      digitalWrite(Rectification2Motor1Pin, HIGH);
      digitalWrite(Rectification2Motor2Pin, LOW);
      ////////////// A delay may be requireed as the valve ages
      delay(100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(Rectification2EnablePin, LOW);
      digitalWrite(Rectification2Motor1Pin, LOW);
      digitalWrite(Rectification2Motor2Pin, HIGH);
      SIpreviousMillis = SIcurrentMillis;
    }
  }
  //////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////

  void openStillHeadValve() {
    digitalWrite(StillHeadEnablePin, HIGH);
    digitalWrite(StillHeadMotor1Pin, LOW);
    digitalWrite(StillHeadMotor2Pin, HIGH);
  }

  void closeStillHeadValve() {
    digitalWrite(StillHeadEnablePin, HIGH);
    digitalWrite(StillHeadMotor1Pin, HIGH);
    digitalWrite(StillHeadMotor2Pin, LOW);
  }


  void StillHeadValveOpenControl() { // StillHead Open valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(StillHeadEnablePin, HIGH);
      digitalWrite(StillHeadMotor1Pin, LOW);
      digitalWrite(StillHeadMotor2Pin, HIGH);
      ////////////// A delay may be required here as the valve ages
      delay(100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(StillHeadEnablePin, LOW);
      digitalWrite(StillHeadMotor1Pin, LOW);
      digitalWrite(StillHeadMotor2Pin, LOW);
      SIpreviousMillis = SIcurrentMillis;
    }
  }

  void StillHeadValveCloseControl() { // StillHead Close valve control for sparge
    long interval = 100;
    long shortInterval = 50;
    unsigned long currentMillis = millis();
    long previousMillis = 0;
    unsigned long SIcurrentMillis = millis();
    long SIpreviousMillis = 0;
    if (currentMillis - previousMillis > interval) {
      digitalWrite(StillHeadEnablePin, HIGH);
      digitalWrite(StillHeadMotor1Pin, HIGH);
      digitalWrite(StillHeadMotor2Pin, LOW);
      ////////////// A delay may be requireed as the valve ages
      delay(100);
      previousMillis = currentMillis;
    }

    if (SIcurrentMillis - SIpreviousMillis > shortInterval) {
      digitalWrite(StillHeadEnablePin, LOW);
      digitalWrite(StillHeadMotor1Pin, LOW);
      digitalWrite(StillHeadMotor2Pin, LOW);
      SIpreviousMillis = SIcurrentMillis;
    }
  }