Capteur de température DS18B20

Bonjour,
J' aurai besoin d' aide pour mon projet thermomètre digital avec une sonde de température DS18B20.
Je voudrai simplement afficher la température avec un seul chiffre après la virgule, j' ai pas trouve lol
Merci d'avance pour votre aide.
Voici le code :

  //-----------------------------temperature--------------------
byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8]; 
  float celsius;
  if ( !ds.search(addr))   
    //search for next object on Onewire bus. For the first found, continue loop, if none found, restart from 0 
  {
    ds.reset_search();
    delay(250);
    return;
  }
  if (OneWire::crc8(addr, 7) != addr[7]) //Check if there is no errors on transmission
  {
      Serial.println("CRC invalide...");
      return;
  }
  if(addr[0] == 0x10)      //Check if it's a DS18b20 on the bus or not
      {
        type_s = 1;
      } else type_s=0;
  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);         // start conversion, with parasite power on at the end
  //delay(1000);     
  present = ds.reset();
  ds.select(addr);    
  ds.write(0xBE);         // Read Scratchpad
  for ( i = 0; i < 9; i++) 
  {           // we need 9 bytes
    data[i] = ds.read();
  }
  // convert the data to actual temperature
  unsigned int raw = (data[1] << 8) | data[0];
  if (type_s) 
  {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) 
    {
      // count remain gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } 
  else 
  {
    byte cfg = (data[4] & 0x60);
    if (cfg == 0x00) raw = raw << 3;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw << 2; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw << 1; // 11 bit res, 375 ms
  }
  celsius = (float)raw / 16.0;
  lcd.setCursor(10, 0);
  lcd.print(celsius); // affichage temperature
  lcd.print((char)223); // affichage caractere degres
     
}

Bonjour et bienvenue

C'est dans la doc : http://arduino.cc/en/Serial/Print

An optional second parameter specifies the base (format) to use; permitted values are BIN (binary, or base 2), OCT (octal, or base 8), DEC (decimal, or base 10), HEX (hexadecimal, or base 16). For floating point numbers, this parameter specifies the number of decimal places to use. For example:

Serial.print(78, BIN) gives "1001110"
Serial.print(78, OCT) gives "116"
Serial.print(78, DEC) gives "78"
Serial.print(78, HEX) gives "4E"
Serial.println(1.23456, 0) gives "1"
** Serial.println(1.23456, 2) gives "1.23"**
** Serial.println(1.23456, 4) gives "1.2346"**

merci barbudor mais je débute en Arduino... et j ai du mal avec le code je comprend pas tout lol

en gros faudrai que je mette :
lcd.print(Celsius,2); pour avoir 1 chiffre apres la virgule ?

lcd.print(Celsius,1); pardon lol

bonjour,
lcd.print(celsius,1); // affichage temperature

Grillé, pas réveillé ce matin

ok ! merci a vous pour votre aide, c'était tout bête et j ai cherche la complication lol
Bon week a tous :wink: