//
// Exercício 1 da lista Sistemas Embarcados
// 5.9 Project 5 - Temperature measurement –
// using an external temperature sensor and with parallel LCD
//Matheus Manfio - 30/11/23
//
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <OneWire.h>
#include <LiquidCrystal.h>
#define ONE_WIRE_BUS 26
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
lcd.begin(16, 2);
lcd.clear();
sensors.begin();
delay(1000);
Serial.begin(9600);
}
void loop() {
sensors.requestTemperatures();
float tempC =
sensors.getTempCByIndex(0); // variável recebe a temperatura em ºC
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temperatura:");
lcd.setCursor(0, 1);
lcd.print(tempC+104+46);
lcd.setCursor (6,1);
lcd.print("Celsus");
delay(1000);
}