Arduino + 3x DS18B20 + LCD + FAN

Hello!

I am trying to make small project on arduino. I want to get three temperature readings from different computer parts, print it on LCD (2x16) and use it to control 4 computer fans.

Everything works fine for now, except that i've got some strange signs on my lcd. On the other hands the same data on serial is correct.

Can anybody help me?

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>

// Data wire is plugged into pin 9 on the Arduino

#define ONE_WIRE_BUS 9

int fan = 10;

// Setup a oneWire instance to communicate with any OneWire devices 
OneWire oneWire(ONE_WIRE_BUS);
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

// Pass our oneWire reference to Dallas Temperature. 

DallasTemperature sensors(&oneWire);

 
void setup(void)
{
lcd.begin(16, 2);
Serial.begin(9600);
sensors.begin();

//set up frequency of 9 & 10 pin on 32MHz
TCCR1B = TCCR1B & 0b11111000 | 0x01;
}

void loop(void)
{
float temp1=0, temp2=0, temp3=0;
Serial.print("Requesting temperatures...");
sensors.requestTemperatures();
delay(250);

Serial.println("DONE");
lcd.clear();
lcd.setCursor(0,0);
temp1=sensors.getTempCByIndex(0);
lcd.print(temp1);
Serial.println(temp1);

lcd.setCursor(8,0);
temp2=sensors.getTempCByIndex(1);
lcd.print(temp2);
Serial.println(temp2);

lcd.setCursor(0,1);
temp3=sensors.getTempCByIndex(2);
lcd.print(temp3);
Serial.println(temp3);

if ( (temp1 + temp2 + temp3)/3 > 22)
    {
    analogWrite(fan, 127);
    lcd.setCursor(8,1);
    lcd.print(127);
    }
else 
    {
    analogWrite(fan, 0);
    lcd.setCursor(8,1);
    lcd.print(0);
    }
delay(500); 
}

Hello

do you find a solution?

bbye