Coder Social home page Coder Social logo

rtc_m41t62's Introduction

This is a fork of JeeLab & Adafruit's real time clock library for Arduino modified to work with the ST M41T62 real time clock IC. Significant changes are to the square wave function and added alarm functions. See example sketches.

For details on using this library with an RTC module, see the guide at: https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/overview

To download. click the DOWNLOADS button to the right, and rename the uncompressed folder RTClib.

Place the RTClib folder in your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

2022 Update by Trey. Added alarm get functions

  • DateTime alarmGet(): Get the DateTime of the alarm set.
DateTime AlarmTime = rtc.alarmGet();
  • int alarmEnabled(): Get 0/1 if an alarm is currently enabled.
int en = rtc.alarmEnabled(); // if there is no alarm enabled, like a first start, then we need to set one!
printf("alarmEnable: %d\n", en);

Check the OF bit. Good to know on first start or if backup battery fails.

int rtc_OF = rtc.checkOF(); // Returns 1 if oscillator fail is set, 0 if not.

Added alarm functions

  • alarmSet(DateTime): Sets alarm to desired time. Uses DateTime variable. Basically the same as adjust() but sets the alarm time instead.
  • alarmRepeat(int): Returns or sets alarm repeat mode
    • 1: once per second
    • 2: once per minute
    • 3: once per hour
    • 4: once per day
    • 5: once per month
    • 6: once per year
  • alarmEnable(bool): True/False to enable/disable alarm

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.