string() function not accepting DS1302 variables
Francisco
Posts: 26
Hello all,
I am trying to set the time in the BackPack using a DS1302 time chip with the following code:
the object im using for the ds1302 is from here: http://obex.parallax.com/objects/519/
The compile error i get is: Error: Not a Long Address
basically the string() is not accepting the date variables.
To debug, I tried creating new variables of type LONG and then reassigned the date values to these new longs to see if it would work but still not working.
Does anyone have a clue?
Thank you.
I am trying to set the time in the BackPack using a DS1302 time chip with the following code:
rtc.readTime( @hour, @minute, @second ) 'read time from DS1302 rtc.readDate( @day, @month, @year, @dow ) 'read date from DS1302 pr.str(string(SETTIM, year, month, day, hour, minute, second)) 'set time on backpack
the object im using for the ds1302 is from here: http://obex.parallax.com/objects/519/
The compile error i get is: Error: Not a Long Address
basically the string() is not accepting the date variables.
To debug, I tried creating new variables of type LONG and then reassigned the date values to these new longs to see if it would work but still not working.
Does anyone have a clue?
Thank you.
Comments
pr.out(SETTIM)
pr.out(year)
pr.out(month)
pr.out(day)
pr.out(hour)
pr.out(minute)
pr.out(second)
I don't know what kind of device is handled by pr.
If it's a serial port (like FullDuplexSerial) you'll need to use .tx instead of .out
Green, your example worked perfectly! You are one of those members here that I can count on helping out. Thanks again.