its a code wich read the temperature with a thermistor . and by clicking a button turn relay on and off.
the problem with this code is i recieve Temprature with comma. for example (20.01 C°)
but i want this resault as (20 C°) and ingnore the comma .
can anyone help me ?
''' #the code is
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int ThermistorPin = A0;
int Vo;
float R1 = 100000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
const int relay = 10;
const int button = 8;
int state = 0;
void setup()
{
pinMode(button, INPUT);
pinMode(relay, OUTPUT);
digitalWrite(relay, LOW);
Serial.begin(9600);
}
void loop(){
Vo = analogRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2logR2 + c3logR2logR2logR2));
T = T - 273.15;
lcd.print("Temp:");
lcd.setCursor(6, 1);
lcd.print(T);
lcd.setCursor(0, 1);
delay(50);
state=digitalRead(button);
if (state==1 && T < 28)
{digitalWrite (relay, HIGH);}