Code Monkey home page Code Monkey logo

arduino-due-rtc-library's People

Contributors

ivankravets avatar markuslange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-due-rtc-library's Issues

validation functions needed

The SAM supports validating time/date/etc. by register RTC_VER. I assume, that that register reports invalid values when the SAM comes up. It would be very useful for me, to check if its necessary to synchronize the time by NTC.

RTC Time Reset on Due Restart

I noticed that if the Due is programmed using this library, the date will only be correct if the unit is not powered down. If you program the time in by uncommenting out the rtc_clock.set lines to 'burn' the current time to the RTC, then commen them out to burn the rest of the program onto the chip, then upon restart of the unit the time reverts to 1/1/2007 0:0:0.

Expected behavior is rtc_clock.get should return the current time, regardless of how long the due has been powered down. My test code is below, and it's likely that I'm doing something wrong or not understanding something about the library!

include <SPI.h>

include <SD.h>

include <rtc_clock.h>

// Select the Slowclock source
RTC_clock rtc_clock(XTAL);

unsigned int currentTime = 0;
unsigned int prevTime = 0;
unsigned int prevSerialTime = 0;
/////////////////////////////////////////////////////////////////////////
void setup() {
Serial.begin(9600);

//rtc_clock.init();
//rtc_clock.set_time(TIME);
//rtc_clock.set_date(DATE);
//Only run these once to setup the RTC clock (assuming the clock has a good battery)
}
/////////////////////////////////////////////////////////////////////////
void loop() {
currentTime = millis();
if (currentTime - prevSerialTime > 5000) {
prevSerialTime = currentTime;

  String dataString = "";
  dataString += rtc_clock.get_months();
  dataString += "/";
  dataString += rtc_clock.get_days();
  dataString += "/";
  dataString += rtc_clock.get_years();
  dataString += " ";
  dataString += rtc_clock.get_hours();
  dataString += ":";
  dataString += rtc_clock.get_minutes();
  dataString += ":";      
  dataString += rtc_clock.get_seconds();
  dataString += ",";
  dataString += "data1";
  dataString += ",";
  dataString += "data2";
  Serial.println(dataString);
}

}

wrong date with Due_RTC_Simple_Sample_oneline_time_and_date

Can you please check the date in the output of Due_RTC_Simple_Sample_oneline_time_and_date example?
I always get
Date: Mon 01.01.2007

I use RTC_clock rtc_clock(RC);

other question why XTAL doesn't work and what is this option exactly?

thanks

Summertime

Hi Markus,
Great library !
Found little issue while checking the examples:

In the second and third example (Simple_German_Summertime and Simple_German_Timing_Summertime there is a difference. The Due_RTC.timing() function is called. Due_RTC.timing() function seems to be required to correctly return the summertime YES/NO value.
In the CPP there is indeed a call for the meztime variable,(mez =CET for non German speaking !) which is set in the Due_RTC.timing() function.
This explains why the Simple_German_Summertime.ino is not working correctly.
You may want to change the Summertime() function to avoid calling the meztime variable.

Summertime

Thank you for your nice library. Installed your newest version and ran the second summertime example. There is a problem in the Simple _German_summertime example:

Apparently the example is not working
The example keeps returning "Summer time: No".
Do I make a mistake somewhere?

RTC with leap year

Markus,

Can you please test this library on a Due now? I am finding some issues when setting date, and I think it is probably because of leapyear?

set from unixtimestamp

Hello Markus,
is there a way to set the time from a unix timestamp ?
This can be useful when requesting time from NTP server.

Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.