DS18B20

// Termostat 5 temerature sensors DS18B20.

#include <EEPROM.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
 
OneWire  oneWire(15); //
DallasTemperature ds(&oneWire);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

const byte OUT[5] = {13, 12, 11, 3, 2};
 
byte pos;
byte tempOUTon[5];  
float tempSensor[5]; 
byte qty; 

//
DeviceAddress sensor1 = {0x28, 0xA8, 0x3E, 0xF9, 0x05, 0x0, 0x0, 0x12};
DeviceAddress sensor2 = {0x28, 0xE6, 0xBD, 0x3B, 0x05, 0x0, 0x0, 0xCF};
DeviceAddress sensor3 = {0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
DeviceAddress sensor4 = {0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
DeviceAddress sensor5 = {0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};

byte gradus[8] = {
  0b00110,
  0b01001,
  0b01001,
  0b00110,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};
byte on[8] = {
  0b00110,
  0b01111,
  0b11111,
  0b11111,
  0b11111,
  0b11111,
  0b11110,
  0b01100
};

void readSet(){
  for (byte i = 0; i < qty; i++) tempOUTon[i] = EEPROM.read(i);
}
 
void outOff(){ 
  for (byte i = 0; i < qty; i++) digitalWrite(OUT[i], LOW);
}

void erorr(){ 
  outOff();   
  lcd.clear();
  lcd.print("sensor error");
   while(1){ 
      analogWrite(10, 100);
      delay(500);
      analogWrite(10, 255);
      delay(500);
  }
}
////

byte key(){ 
  int val = analogRead(0);
    if (val < 50) return 5;
    else if (val < 150) return 3;
    else if (val < 350) return 4;
    else if (val < 500) return 2;
    else if (val < 800) return 1;
    else return 0;  
}
////  

void setMenu(byte pos){ 
 outOff();
 lcd.clear();
  
  while(1){     
    byte KEY = key();
    
    lcd.setCursor(2, 0);
    lcd.print("Out:");
    lcd.print(pos+1);
    lcd.setCursor(9, 0);
    lcd.print("Pin:");
    lcd.print(OUT[pos]);
    lcd.print("    ");
     
    lcd.setCursor(0, 1);   
    lcd.print(" PinON: ");
    lcd.print(tempOUTon[pos]);
    lcd.write(1);
    lcd.print("C <>");
    
    if (KEY == 2) { 
      tempOUTon[pos]--;   
        if (tempOUTon[pos] > 125) tempOUTon[pos] = 0;
      EEPROM.write(pos, tempOUTon[pos]); 
     }
     else if (KEY == 5){
       tempOUTon[pos]++;
         if (tempOUTon[pos] > 125) tempOUTon[pos] = 0;
       EEPROM.write(pos, tempOUTon[pos]);    
     } 
 
   delay(200);
  }/////   
}//

void getTemp(){ 
   ds.requestTemperatures();    
   
   tempSensor[0] = ds.getTempC(sensor1); 
   tempSensor[1] = ds.getTempC(sensor2); 
   tempSensor[2] = ds.getTempC(sensor3);
   tempSensor[3] = ds.getTempC(sensor4);
   tempSensor[4] = ds.getTempC(sensor5);
} 

void sensorTest(){ 
   ds.begin();
   if(ds.getDeviceCount() != qty) erorr();
}

void setup() {
 //  Serial.begin(9600); 
  ds.begin();   
  qty = ds.getDeviceCount(); 


  for (int i = 0; i < qty; i++) pinMode(OUT[i], OUTPUT);  
  for (int i = 0; i < qty; i++) digitalWrite(OUT[i], LOW);
  
  lcd.createChar(1, gradus);
  lcd.createChar(2, on);
  lcd.begin(16, 2);
  lcd.clear();
  
  readSet();    
}

void loop() {   
  if (key() == 1) setMenu(pos); // если нажата селект, уходим в настройки
  
  else if (key() == 4 && pos < qty-1) pos++; // крутим позицию
  else if (key() == 3 && pos != 0) pos--;
  
  sensorTest(); 
  getTemp(); 
 
  
  for (int i = 0; i < qty; i++) { 
    if (tempSensor[i] < tempOUTon[i]) digitalWrite(OUT[i], HIGH);
    else digitalWrite(OUT[i], LOW);
  } 
  
  ////
  lcd.setCursor(0, 0); 
  lcd.print(pos+1); 
  lcd.print(". ");
  lcd.print(tempSensor[pos], 1); 
  lcd.write(1);
  lcd.print("C  ");
  lcd.setCursor(2, 1);
  lcd.print(tempOUTon[pos]); 
  lcd.write(1);
  lcd.print("C  ");    
  
  lcd.setCursor(11, 0);   
    for (int i = 0; i < qty; i++){ 
      if (digitalRead(OUT[i])) lcd.write(2);
      else lcd.print(" ");
    }
  lcd.setCursor(11, 1);  
    for (int i = 0; i < qty; i++) lcd.print(i+1); 

}

HI ALL!!!.. This code writes " Error Compiling " what a mistake here, you can tell me?- I can not fill in the Arduino!!!..

This code writes " Error Compiling "

I'm sure it tells you something more, but you are not telling us. In the IDE, navigate File>Preferences>Settings and select "Show verbose output". Copy and paste the message you get when you try to compile your code.

Your code compiles fine for me with a UNO and IDE 1.6.9.

cattledog:
I’m sure it tells you something more, but you are not telling us. In the IDE, navigate File>Preferences>Settings and select “Show verbose output”. Copy and paste the message you get when you try to compile your code.

Your code compiles fine for me with a UNO and IDE 1.6.9.

" Sorry, it seems like your code has some errors preventing us from running the code. "
" 4:21: fatal error: OneWire.h: No such file or directory"

cattledog:
I'm sure it tells you something more, but you are not telling us. In the IDE, navigate File>Preferences>Settings and select "Show verbose output". Copy and paste the message you get when you try to compile your code.

Your code compiles fine for me with a UNO and IDE 1.6.9.

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Uno"

sketch_aug21a.ino:4:21: fatal error: OneWire.h: No such file or directory
compilation terminated.
Multiple libraries were found for "DallasTemperature.h"

Used: C:\Users\User\Documents\Arduino\libraries\DallasTemperature

Not used: C:\Users\User\Documents\Arduino\libraries\DallasTemperature1

Not used: C:\Users\User\Documents\Arduino\libraries\Arduino-Temperature-Control-Library-master

Not used: C:\Users\User\Documents\Arduino\libraries\arduino_986957

Multiple libraries were found for "LiquidCrystal.h"

Used: C:\Users\User\Documents\Arduino\libraries\LiquidCrystal

Not used: D:\ARDUINO\arduino-1.6.5-r2-windows\arduino-1.6.5-r2\libraries\LiquidCrystal

Error compiling.

sketch_aug21a.ino:4:21: fatal error: OneWire.h: No such file or directory

Where on your computer is the OneWire library?

cattledog:

sketch_aug21a.ino:4:21: fatal error: OneWire.h: No such file or directory

Where on your computer is the OneWire library?

C:\Users\User\Documents\Arduino\libraries

cattledog:

sketch_aug21a.ino:4:21: fatal error: OneWire.h: No such file or directory

Where on your computer is the OneWire library?

what I must remake to " 4 NTC " sensors connected and showed me on the screen 4-C temperature?

what I must remake to " 4 NTC " sensors connected and showed me on the screen 4-C temperature?

The DS18B20 are "one wire" devices, and they require the library OneWire.h. The error says that the IDE can not find that library.

Try to reinstall it. Make sure that it is in C:\Users\User\Documents\Arduino\libraries in a folder called OneWire, In the folder should be several files-- OneWire.h, OneWire.cpp, Examples, keywords, library.json, and library.properties.