Hi,
I'm having an issue with my lcd adding a 0 to the reading on my ds18b20 on power up. Once I reset the extra character goes away. Also, when I pull the pin for the probe out to check the "Error" message there is a 6 added at the end and when I replace the cable the lcd displays the temp probe reading with r6 at the end.
any help would be greatly appreciated.
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
DallasTemperature sensors(&oneWire);
DeviceAddress Fermenter1 = { 0x28, 0xEE, 0x4C, 0xF4, 0x18, 0x16, 0x02, 0x06 };
DeviceAddress Fermenter2 = { 0x28, 0xFF, 0xA8, 0x96, 0x56, 0x16, 0x04, 0x20 };
float tempF1;
float tempF2;
String err = "Error";
void setup(){
lcd.begin(16,2);
lcd.clear();
Serial.begin(9600);
sensors.begin();
lcd.setCursor(0,0);
lcd.print("Fmntr1 Fmntr2");
sensors.setResolution(Fermenter1, 11);
sensors.setResolution(Fermenter2, 11);
}
void loop(){
tempF1 = sensors.getTempF(Fermenter1);
tempF2 = sensors.getTempF(Fermenter2);
sensors.requestTemperatures();
delay(100);
lcd.setCursor(0,1);
lcd.print(tempF1,1);
if (tempF1 == -196.60){
lcd.setCursor (0,1);
lcd.print (err);
}else{
lcd.setCursor(0,1);
lcd.print(tempF1,1);
}
lcd.setCursor(9,1);
lcd.print(tempF2,1);
if (tempF2 == -196.60){
lcd.setCursor (9,1);
lcd.print (err);
}else{
lcd.setCursor(9,1);
lcd.print(tempF2,1);
}
}