Uno with keyes DS18B20 board temperature sensor trying to display temperature on duinotech 2x16 LCD
Can display temperature on Serial Monitor but not on LCD. Just flashers display on LCD. Up loads OK
My operating system is 8.1. The first 20 lines are libries.
This is my code
#include <LiquidCrystal.h>
#include <BAE910.h>
#include <DS18B20.h>
#include <DS2401.h>
#include <DS2405.h>
#include <DS2408.h>
#include <DS2413.h>
#include <DS2423.h>
#include <DS2431.h>
#include <DS2433.h>
#include <DS2438.h>
#include <DS2450.h>
#include <DS2502.h>
#include <DS2506.h>
#include <DS2890.h>
#include <OneWireHub.h>
#include <OneWireHub_config.h>
#include <OneWireItem.h>
#include <platform.h>
#include <DallasTemperature.h>
LiquidCrystal lcd(2, 3, 4, 9, 10, 11, 12);
//Include library
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup(void)
{
Serial.begin(9600); //Begin serial communication
Serial.println("Arduino Digital Temperature // Serial Monitor Version"); //Print a message
sensors.begin();
lcd.begin(2, 16);
lcd.clear();
}
void loop(void)
{
// Send the command to get temperatures
sensors.requestTemperatures(); // This works
Serial.print("Temperature is: "); // This works
float temp = sensors.getTempCByIndex(0); // This works
Serial.println(temp); // (This works)Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
lcd.setCursor(0,0); // This dose not work
lcd.print("Actual: "); // This dose not work
lcd.print(temp); // This dose not work Only fashers on LCD seen
//Update value every 1 sec.
delay(1000);
}