Let's Make Robots!

Some help here (rtc ds1307 and propeller)

Hello its me again.

I recently got a rtc ds1307 module from sparkfun and Im trying to get what day is today but I am doing something wrong propably so

here is my code.

Code :

CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

_baudRateSpeed = 250_000
   _clockDataPin = 29
  _clockClockPin = 28

OBJ

  rtc: "DS1307_RTCEngine.spin"
  pst: "Parallax Serial Terminal"

PUB main
pst.Start(115200)

rtc.rtcEngineStart(_clockDataPin, _clockClockPin, -1)
repeat
rtc.readTime
pst.str(rtc.clockDay)

(Update: 27/2/2011 ,21:25)

I managed to correct it  the code follows.

Code:

CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

  _baudRateSpeed = 250_000
  _clockDataPin = 29
  _clockClockPin = 28

VAR
  long year
  long month
  long day
  long hour
  long minute
  long second
OBJ

  rtc: "DS1307_RTCEngine.spin"
  pst: "Parallax Serial Terminal"
 

PUB main
  pst.Start(250000)
  rtc.rtcEngineStart(_clockDataPin, _clockClockPin, -1)
  repeat
    rtc.readTime
    year := rtc.clockYear
    month :=rtc.clockMonth
    day := rtc.clockDate
    hour := rtc.clockHour
    minute := rtc.clockMinute
    second := rtc.clockSecond
    pst.str(string("Year:",9))
    pst.str(string("Month:",9))
    pst.str(string("Day:",9))
    pst.str(string("Hour:",9))
    pst.str(string("Minute:",9))
    pst.str(string("Second:",13))
    pst.Dec(year)
    pst.str(string(" ",9))
    pst.Dec(month)
    pst.str(string(" ",9))
    pst.Dec(day)
    pst.str(string(" ",9))
    pst.Dec(hour)
    pst.str(string(" ",9))
    pst.Dec(minute)
    pst.str(string(" ",9))
    pst.Dec(second)
    pst.str(string(" ",9))
    pst.str(string(" ",13))
    waitcnt(cnt + clkfreq)
    pst.str(string(" ",16))