jm_ds1307_demo.spin as alarm clock
stargazer2050
Posts: 89
Quickstart board
Jm_ds1307.spin
Ds1307 running on 28 and 29
Fullduplexserial
Tried to capture the hex into a variable
Minute := term.hex(clock[1], 2)
Tried variable as word and as long.
How to do it?????
Jm_ds1307.spin
Ds1307 running on 28 and 29
Fullduplexserial
Tried to capture the hex into a variable
Minute := term.hex(clock[1], 2)
Tried variable as word and as long.
How to do it?????
Comments
Could i break that into two units and:
[code]
PRI hexToInteger(h) : v
if h => "0" and h =< "9" v := h - "0"
elseif h => "A" and h=< "F" v := h - "A" + 10
elseif h => "a" and h =< "f" v := h = "a" + 10
PRI twoHextoInteger (h2,h1) : v
v := hexToInteger(h2) << 4 | hexToInteger(h1)
[\code]
Without seeing the code, I'm guessing all of the parameters are read into an array of clock bytes. So... If you want to convert that to a hexadecimal value, where $34 minutes = decimal 34 ($22)
Would like to convert to regular decimal so i can capture it in a variable,
Then i can use the variables to figure out the alarm setting.
If the clock speaks 4 digit bcd
Then is displayed on 7 digit lcd with hex
And i only speak regular numbers im in a heap of trouble.
Thats why im askii..ing
Thankyou!
Tip: If you're using the Propeller Tool, but the object you're using in Summary view so you can more easily see the public methods in the object.
No, it doesn't. JM_DS1307 is an object for an RTC that uses an I2C interface. Your application may use serial, the object itself does not.
I chose yer prog because 1. It works 2. It expresses.using fullduplexserial instead of tv or lcd so i could stay consistant.
Ive downloaded your new one and will upgrade to it!
Thanks