ds1307 programming Question
stargazer2050
Posts: 89
Quickstart bd
Ds1307 clock running well
Obex object/420 1307_rtc_driver
Jm_ds1307_demo.spin
User friendly instructions please
Object 420 sets the clock with time command and reads with date command
1. No instruction to get hour in spin code
2. PST conflict
Jm_1307_demo.spin seems to be looking at clock data with no labeling so what is it?
1. How to set time
2. How to get hours only in 12 or 24 hours in spin code in software
Ds1307 clock running well
Obex object/420 1307_rtc_driver
Jm_ds1307_demo.spin
User friendly instructions please
Object 420 sets the clock with time command and reads with date command
1. No instruction to get hour in spin code
2. PST conflict
Jm_1307_demo.spin seems to be looking at clock data with no labeling so what is it?
1. How to set time
2. How to get hours only in 12 or 24 hours in spin code in software
Comments
1: In the version of that program on my PC, it's pretty plain:
2: I have a lot of experience with time-based products and it's always easier to use 24-hour format. If you need to output 12-hour format for the user, that's very easy to do; a case statement can convert your 24-hour hours to 12 -- something like this:
BTW, that was a quick demo, it's not a full-blown object. At any rate, you should download and read the DS1307 documentation before using my code on another object. The fact that someone else has created an object or demo does not relieve you of your responsibility to understand the component in question.
2. I see the pub set_time (in my version its pub settime' but cant get it to call to see what it does
3. I prefer 24 hour but have to wait for this afternoon to see which variable is the 24 hour one, as its not labeled
4. BTW ??
5. Ds1307 documentation? Do you mean the datasheet or your doc? Read the datasheet, cant find your doc.
6. Are you relieved of explaining what you've posted?
7. Still would like how to extract just the hour and put it to a variable