Shop OBEX P1 Docs P2 Docs Learn Events
i2c object error? — Parallax Forums

i2c object error?

El PaisaEl Paisa Posts: 375
edited 2007-04-26 08:26 in Propeller 1
I am trying to use some of the routines of the i2c object by James Burrows
Seems there is confusion between Day and Date.
ds1307object.getDays seems to work OK giving the day of the month, but
ds1307object.getDate (supposed to be the day of the week) always returns 0

In the declarations
DS1307Obj*· in i2clibrary_version1.2
PUB· getDate : ds_seconds
PUB· getDays : result··
Whats is going on?

·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-21 19:39
    ds1307object.getDate just reads the DS1307 values and will always return zero as written.
    I don't know why there's a ": ds_seconds" in the declaration since it's not used. By default,
    any method will return zero if another value is not set.

    If ds1307object.getDays is working, then getDate must be working properly since getDays
    just fetches the value read by getDate and converts it to an integer.
  • JavalinJavalin Posts: 892
    edited 2007-04-26 08:26
    Hi,

    Yes its been raised before - i've the intention of correcting and testing it - but have had no time for ages!

    Feel free to correct and modify for your own purposes - its not written to do everything for everybody!

    Cheers,

    james
Sign In or Register to comment.