/********************************************************************/
// First we include the libraries
#include <OneWire.h> 
#include <DallasTemperature.h>
#include <EEPROM.h>

/********************************************************************/
// Data wire is plugged into pin 2 on the Arduino 
#define ONE_WIRE_BUS 2 


/********************************************************************/
// Setup a oneWire instance to communicate with any OneWire devices  
// (not just Maxim/Dallas temperature ICs) 
OneWire oneWire(ONE_WIRE_BUS); 
/********************************************************************/
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);
/********************************************************************/ 
unsigned long aktualnyCzas = 0;
unsigned long zapamietanyCzas = 0;
void setup(void) 
{ 
    pinMode(3, OUTPUT);
  digitalWrite(3, LOW);
    pinMode(4, OUTPUT);
  digitalWrite(4, LOW);
    pinMode(5, OUTPUT);
  digitalWrite(5, LOW);
   pinMode(10, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);
  
 // start serial port 
 Serial.begin(9600); 

 // Start up the library 
 sensors.begin(); 

} 
void loop(void) 
{ 
 // call sensors.requestTemperatures() to issue a global temperature 
 // request to all devices on the bus 
/********************************************************************/
// Serial.print(" Requesting temperatures..."); 
 sensors.setResolution(9);
 sensors.requestTemperatures(); // Send the command to get temperature readings 
 
// Serial.println("DONE"); 
/********************************************************************/
static int TempSet =35; 
aktualnyCzas = millis();

float (T1) = (sensors.getTempCByIndex(0));
float (T2) = (sensors.getTempCByIndex(1));

byte T1Limit = 30;
byte T2Limit = 31;

 Serial.print("T 1:..... "); 
 Serial.println(sensors.getTempCByIndex(0)); 
  Serial.println (T1);
  Serial.print("T 2:..... "); 
 Serial.println(sensors.getTempCByIndex(1));
 Serial.println (T2);

   Serial.println(".........................");


if ((T1)>27.00)
{
   (digitalWrite(3,LOW));
  }
else {  (digitalWrite(3,HIGH)); 
}
if ((T2)>27.00)
{
   (digitalWrite(4,LOW));
  }
else {  (digitalWrite(4,HIGH)); 
}
  Serial.print (T1Limit);
  Serial.print("..  ..  ..  ");
 Serial.println (T2Limit);
   delay(2000); 
   
} 
