pzaepfel / ds1307

Automatically exported from code.google.com/p/ds1307
0 stars 0 forks source link

I can make it work in conjuntion whith LCD library #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
i try to use this library in conjunctioin whith the lcd library y 4 bit
mode but I get strange results this is mi code:

#include "WProgram.h"
#include "Wire.h"
#include <DS1307.h> // written by  mattt on the Arduino forum and modified
by D. Sjunnesson

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{

  RTC.stop();
  RTC.set(DS1307_SEC,1);        //set the seconds
  RTC.set(DS1307_MIN,23);     //set the minutes
  RTC.set(DS1307_HR,12);       //set the hours
  RTC.set(DS1307_DOW,4);       //set the day of the week
  RTC.set(DS1307_DATE,5);       //set the date
  RTC.set(DS1307_MTH,3);        //set the month
  RTC.set(DS1307_YR,9);         //set the year
  RTC.start();

lcd.begin(1, 2);
   lcd.setCursor(4,0 );
   lcd.print("Tomas help");

}

void loop()
{

}

}

The ouput of the lcd doesn't lock as expected, and when I try to get the
time it doesnt work

Original issue reported on code.google.com by atomsm...@gmail.com on 1 Apr 2010 at 5:27

GoogleCodeExporter commented 8 years ago
void loop() {
  lcd.setCursor(3, 0);
  lcd.print(rtc.getTimeStr());
  lcd.setCursor(0, 1);
  lcd.print(rtc.getDOWStr(FORMAT_SHORT));
  lcd.setCursor(6, 1);
  lcd.print(rtc.getDateStr());
}

Original comment by s.yove...@gmail.com on 19 Apr 2013 at 11:53