Merge pull request #3294 from agdl/TemperatureWebPanelFix

Added literal float to improve precision
This commit is contained in:
Federico Fissore 2015-06-05 12:45:59 +02:00
commit 99bc0a0ec0
1 changed files with 2 additions and 2 deletions

View File

@ -98,9 +98,9 @@ void loop() {
Serial.println(timeString);
int sensorValue = analogRead(A1);
// convert the reading to millivolts:
float voltage = sensorValue * (5000 / 1024);
float voltage = sensorValue * (5000.0f / 1024.0f);
// convert the millivolts to temperature celsius:
float temperature = (voltage - 500) / 10;
float temperature = (voltage - 500.0f) / 10.0f;
// print the temperature:
client.print("Current time on the Yún: ");
client.println(timeString);