Ok I had read the advice from Faraday and I create this sketch...
I use references from:
http://arduino-info.wikispaces.com/Brick-Temperature-DS18B20
http://ladyada.net/learn/arduino/lesson5.html
#include <OneWire.h> //incert OneWire Library
#include <DallasTemperature.h> //incert Dallas Temperature Library
#define ONE_WIRE_BUS 2 //conect to pin 2 (I dont know if this is correct)
OneWire ourWire (ONE_WIRE_BUS); //honestly I dont know what this mean
DallasTemperature sensors (ourWire); // tell DallasTemp. Library to use oneWire Library
int R1= 10; //R1 connected to digital pin 10
int R2= 11; //R2 connected to digital pin 11
int R3= 12; //R3 connected to digital pin 12
void setub ()
{
pinMode (R1,OUTPUT); //set the digital pin 10 as output
pinMode (R2,OUTPUT); //set the digital pin 11 as output
pinMode (R3,OUTPUT); //set the digital pin 12 as output
sensors.begin (); //start up the DallasTemp. Library
}
void loop ();
{
digitalWrite (R1, HIGH); // (STEP 1) switch on the digital pin 10
digitalWrite (R2, HIGH); // (STEP 1) switch on the digital pin 11
digitalWrite (R3, HIGH); // (STEP 1) switch on the digital pin 12
sensors.requestTemperatures (); // (STEP 2) send the commant to get temperatures
if (getTempC) ==> 50 // (STEP 3 this step is certainly wrong) if the Temp is equal or bigger than 50 degrees Celsius
{
digitalWrite (R1, LOW); // (STEP 4) switch off the digital pin 10
}
if (getTempC) ==> 55 // (STEP 5) if the Temp. is equal or bigger than 55 degrees Celsius
{
digitalWrite (R2, LOW); // (STEP 6) switch off the digital pin 11
}
if (getTempC) ==> 60 // (STEP 7) if the Temp. is equal or bigger than 60 degrees Celsius
{
digitalWrite (R3, LOW) // (STEP 8) switch off the digital pin 12
}
} //end of loop
The STEP 3,5,7 is my biggest problem because I dont know how to tell the arduino << read the temperature in Celsius and then if the temp is equal or bigger than 50 degrees Celsius, do this action>>
If you have noticed any mistakes please let me know.
Right now I dont have my Arduino so please run my sketch and let me know about the errors
Thanks for your time...