ds3231-rtc

1.0.4 • Public • Published

DS3231 RTC module

This package is an attempt to make it easy to read data from ds3231 Real time clock module connected to Raspberry pi through I2C.

However there might be a delay when a function is called. To get few details at same time like minutes and hours together, one function should be called withing the callback of the other function. please check example below.

Usage

const rtc = require('ds3231-rtc');

rtc.min((data1)=>{
    rtc.hr((data2)=>{
                    console.log('Time '+ data2 +':'+ data1);
                    
})}); 

To set time to module

rtc.set() 

Other functions

rtc.sec((data)=>{}) // seconds

rtc.min((data)=>{}) // minutes

rtc.hr((data)=>{}) // hours

rtc.mn((data)=>{}) // month

rtc.date((data)=>{}) // date

rtc.yr((data)=>{}) // year

Readme

Keywords

Package Sidebar

Install

npm i ds3231-rtc

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

10.2 kB

Total Files

4

Last publish

Collaborators

  • imeshsps