Hello there guys,
This is the first big project that I am currently doing (I have just done some simple LED traffic lights before this) and I have a code that I found online. Now the code works 100% flawlessly, but I am trying to get it to read in 0.1 degree increments and not 0.5 degree increments. I have heard that it is possible by changing the resolution, but I am unsure on how I can achieve this. My current code is as follows:
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
//DS18b20 connected to D38
#define DS18B20 38
// Connections: Sainsmart LCD/Keypad shield
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
OneWire oneWire(DS18B20);
DallasTemperature sensors(&oneWire);
float TempInC ;
void setup()
{
//Serial.begin(9600);
delay(1000);
//start reading
sensors.begin();
//setup the LCD
lcd.begin(16, 2); // start the library
lcd.setCursor(0,0);
lcd.print("TEMPERATURE");
}
void loop()
{
//read temperature and output via LCD
sensors.requestTemperatures();
lcd.setCursor(0,1);
lcd.print(sensors.getTempCByIndex(0));
lcd.setCursor(6,1);
lcd.print("celsius");
}
Thank you in advanced!
Jnrdingo