[code]
//    Remember outputs need to be low to energise the relays
 
 int myPin = A2; // INPUT Analogue Sensor
   int stoke = 2; // INPUT Stoking Temp Sensor (Bottom of store)
   int houseUFH = 3; // OUTPUT UFH Relay
     int annex = 5; // INPUT Annex Pump
      int house = 6; // INPUT House Pump
       int alarm = 7; // OUTPUT Alarm Light Relay
        int clok = 8; // INPUT from Clock
         int veryHot = 9; // INPUT  Boiler too hot
          int StoreUFH = 10; // OUTPUT Store UFH Relay
           int button = 11;   // alarm cancel button
             int ledPin = 13;

      int dt = 250; // Delay of 250 mSec

void setup() {
  Serial.begin(9600);
   
    pinMode(myPin,INPUT);          //  pin A2
     pinMode(stoke,INPUT);         // stat acts 70deg    pin 2
      pinMode(houseUFH,OUTPUT);   // Yellow Relay Wire  pin 3
        pinMode(annex,INPUT);      //    pin 5
         pinMode(house,INPUT);     //    pin 6
          pinMode(alarm,OUTPUT);           // Blue Relay Wire   pin 7
           pinMode(clok,INPUT);            // 5v from clock      pin 8
            pinMode(veryHot,INPUT);        // stat acts at 85deg   pin 9
             pinMode(StoreUFH,OUTPUT);   // Green Relay Wire  pin 10
              pinMode(button,INPUT);        //  push button      pin 11
               pinMode(ledPin,OUTPUT);      // Indicator LED     pin13
               
}

void loop() {

int analog = analogRead(myPin);     // Reads data from myPin (A2) pin and puts in analog Int
int readStoke = digitalRead(stoke); // Reads data from stoke (2) and puts in readStoke Int
int readAlarm = digitalRead(alarm); // Reads data from alarm (7) and puts in readAlarm Int
int readClock = digitalRead(clok);  // Reads data from clok (8) and puts it in readClock Int
int readHot = digitalRead(veryHot); // Reads data from veryHot (9) and puts it in readHot Int
int readUFH = digitalRead(StoreUFH);// Reads data from pin (10) and puts it in readUFH Int
int readBut = digitalRead(button);  // Reads data from button (11) and puts it in readBut Int

int alarmState = digitalRead(alarm);  // Reads data from pin (7)    and puts in alarmState int

if (readClock == 1){
    digitalWrite(houseUFH,LOW);         // Turns House UFH on pin3  
    Serial.println("House UFH Turned On");
}
  if (readClock== 0){
  digitalWrite(houseUFH,HIGH);             // Turns House UFH off readClock == 0
  }

if (readStoke == 0){                    
  Serial.println("Boiler Requires Stoking");
     digitalWrite(alarm,LOW);            //  turns alarm light on    
         
}
else{
  digitalWrite(alarm,HIGH);  //alarms off
}

if (readBut == 1){
  Serial.println("button pressed");
  }
  if (readHot == 1){
  digitalWrite(StoreUFH,LOW);       // Turns Store Pump relay on pin 10
  Serial.println("Store Pump Turned On");
  }
else{
  digitalWrite(StoreUFH,HIGH);      // Turns Store Pump Relay off
}
Serial.print("Stoke = ");
Serial.println(readStoke);

Serial.print("Alarm = ");
Serial.println(readAlarm);

Serial.print("UFH = ");             // sending to serial Monitor
Serial.println(readUFH);

Serial.print("Storing = ");             // sending to serial Monitor
Serial.println(readHot);
Serial.println(     );

delay (dt*40);

// here is where you'd put code that needs to be running all the time.
 
  // check to see if it's time to blink the LED; that is, if the
  // difference between the current time and last time you blinked
  // the LED is bigger than the interval at which you want to
  // blink the LED.
 
  unsigned long currentMillis = millis();
 
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store

unsigned long previousMillis = 0;        // will store last time LED was updated

// constants won't change:

const long interval = 4000;           // interval at which to blink (milliseconds)

if(currentMillis - previousMillis > interval)  {
    // save the last time you blinked the LED
   
    previousMillis = currentMillis;  
 
    // if the LED is off turn it on and vice-versa:
   
    if (alarmState == LOW)
      alarmState = HIGH;
    else
      alarmState = LOW;
 
    // set the alarm relay with the alarmState of the variable:
    digitalWrite(alarm, alarmState);
  
}

}
[/code]