Picproje Elektronik Sitesi

MİKRODENETLEYİCİLER => Atmel => Konuyu başlatan: veliusta - 12 Temmuz 2014, 01:34:36

Başlık: Virgülden sonra Tek basamak float
Gönderen: veliusta - 12 Temmuz 2014, 01:34:36
float temp;
int tempPin = 0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  temp = analogRead(tempPin);
  temp = temp * 0.48828125;
  Serial.print("SICAKLIK = ");
  Serial.print(temp);
  Serial.print(" *C");
  Serial.println();
  delay(1000);
}



Örnek: 33,8 *C
Nasıl oluyor
Başlık: Ynt: Virgülden sonra Tek basamak float
Gönderen: atomx - 12 Temmuz 2014, 01:52:31

Serial.print(temp,3)

Hatirladigim kadariyla boyle olmasi lazim
Başlık: Ynt: Virgülden sonra Tek basamak float
Gönderen: veliusta - 12 Temmuz 2014, 01:59:40
Olmadı.

Tamam oldu sağol.
  lcd.print(SICAKLIK, 1);