#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
/********************************************************************/
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 8
int LCDcol = 20;
int LCDrow = 4;
LiquidCrystal lcd (2,3,4,5,6,7);
int time =0 ;
int reading;
float temp;
/********************************************************************/
// 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)
{
lcd.begin(LCDcol, LCDrow);
// lcd.setCursor(0,0);
// lcd.print("LCD to display");
// lcd.setCursor(0,1);
// lcd.print("time and temp");
// lcd.setCursor(3,2);
// lcd.print(" sec");
// lcd.setCursor(5,3);
// lcd.print(" C");
// analogReference(INTERNAL);
// // start serial port
// Serial.begin(9600);
// // Start up the library
// sensors.begin();
}
void loop(void)
{
//question 1, to fisplay the temperatur on the lcd screen
// sensors.requestTemperatures(); // Send the command to get temperature readings
// delay(1000); // Wait 1 second for temperature grab to stabilize
// lcd.setCursor(0,2);
// if(time <100) lcd.print(" ");
// if(time < 10) lcd.print(" ");
// lcd.print(time);
// time++;
// reading= (sensors.getTempCByIndex(0));
// temp = (reading *110.)/1023;
// lcd.setCursor(0,3);
// lcd.print(temp);
// if(time>999) time = 0 ;
// delay(1000);
//to display the scrolling text
String text = "Quick brown fox jump over the lazy dog";
int i = 0 ;
while(i<text.length())
{
lcd.setCursor(0,0);
lcd.print(text.substring(i, text.length()));;
delay(50);
i++;
}
}