#include
#include
#include
#define ONE_WIRE_BUS A2
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup(void)
{ lcd.begin(16, 2);
sensors.begin();
lcd.print("Termodatchik"); }
void loop(void){
lcd.clear();
sensors.requestTemperatures();
float tempC = sensors.getTempCByIndex(0);
lcd.setCursor(0, 0);
lcd.print("FISH");
if(tempC = DEVICE_DISCONNECTED_C)
{ Serial.println("Error: Hatolik");}
else { lcd.setCursor(0, 1);
lcd.print("Harorat=");
lcd.print(tempC);
delay(100); }
}
Do'stlaringiz bilan baham: |