Ok, redone the sketch as simple as possible:
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// Data wire is plugged into port 22 on the Arduino
#define ONE_WIRE_BUS 22
#define TEMPERATURE_PRECISION 12
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
DeviceAddress insideThermometer = { 0x28, 0xCE, 0xE4, 0xA7, 0x03, 0x00, 0x00, 0x9C };
DeviceAddress outsideThermometer = { 0x28, 0xAB, 0x8E, 0x50, 0x04, 0x00, 0x00, 0x95 };
void setup(void)
{
// start serial port
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
float temp1=sensors.getTempC(insideThermometer);
float temp2=sensors.getTempC(outsideThermometer);
Serial.print("Temperature for the device 1 (index 0) is: ");
//Serial.println(sensors.getTempCByIndex(0));
Serial.println(temp1);
Serial.print("Temperature for the device 2 (index 1) is: ");
Serial.println(temp2);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(temp1);
lcd.setCursor(0, 1);
lcd.print(temp2);
}
And now the interesting part, behaviour, it has a cile like this:
Displays temp
1sec
then screen displays bogus characters
1sec
scren displays temp, but has one box on 2nd rov(one complete rectangle)
1sec
scren displays temp, but has one box on 2nd rov(one complete rectangle)