#include <LiquidCrystal.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 3
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
// Assign the addresses of your 1-Wire temp sensors.
DeviceAddress Liegeplatz1 = { 0x28, 0x00, 0xE5, 0xB1, 0x04, 0x00, 0x00, 0x96 };
DeviceAddress Liegeplatz2 = { 0x28, 0xAD, 0xEE, 0x30, 0x05, 0x00, 0x00, 0x0D };
DeviceAddress Liegeplatz3 = { 0x28, 0x50, 0xD5, 0xB1, 0x04, 0x00, 0x00, 0x3C };
DeviceAddress Technik = { 0x28, 0xA8, 0x31, 0xB2, 0x04, 0x00, 0x00, 0xA2 };
void setup(void)
{
lcd.begin(16, 2); //Start LCD
// start serial port
Serial.begin(9600);
// Start up the library
sensors.begin();
// set the resolution to 10 bit (good enough?)
sensors.setResolution(Liegeplatz1, 10);
sensors.setResolution(Liegeplatz2, 10);
sensors.setResolution(Liegeplatz3, 10);
sensors.setResolution(Technik, 10);
}
void printTemperature(DeviceAddress deviceAddress)
{
float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
Serial.print("Error getting temperature");
} else {
Serial.print("C: ");
Serial.print(tempC);
Serial.print(" F: ");
Serial.print(DallasTemperature::toCelsius(tempC));
}
}
void loop()
{
delay(5000);
// Serial.print("Getting temperatures...\n\r");
// sensors.requestTemperatures();
Serial.print("Liegeplatz 1 : ");
printTemperature(Liegeplatz1);
Serial.print("\n\r");
Serial.print("Liegeplatz2 Temperatur is: ");
printTemperature(Liegeplatz2);
Serial.print("\n\r");
Serial.print("Liegeplatz3 Temperatur is: ");
printTemperature(Liegeplatz3);
Serial.print("\n\r\n\r");
Serial.print("Technik Temperatur is: ");
printTemperature(Technik);
Serial.print("\n\r");
}
in dem seriell Monitor kommt dann folgendes
Liegeplatz 1 : C: 85.00 F: 29.44
Liegeplatz2 Temperatur is: C: 85.00 F: 29.44
Liegeplatz3 Temperatur is: C: 85.00 F: 29.44
Technik Temperatur is: C: 85.00 F: 29.44
Woran liegt es das ich die 85° angezeigt bekomme?
Wie kann ich die Anzeige F ausblenden?
Wie bekomme ich den Absatz zwischen Liegeplatz3 und Technik weg?
Danke für eure Hilfe!!