Giter Site home page Giter Site logo

sodaq_ds3231's Introduction

Sodaq_DS3231

This is an Arduino library for the DS3231 RTC (Real Time Clock).

Old README

RDS3231 Class is by Seeed Technology Inc(http://www.seeedstudio.com) and used in Seeeduino Stalker v2.1 for battery management(MCU power saving mode) & to generate timestamp for data logging. DateTime Class is a modified version supporting day-of-week.

Original DateTime Class and its utility code is by Jean-Claude Wippler at JeeLabs http://jeelabs.net/projects/cafe/wiki/RTClib

Released under MIT License http://opensource.org/licenses/mit-license.php

sodaq_ds3231's People

Contributors

mmcp42 avatar rmmsr 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sodaq_ds3231's Issues

Arduino error: 'String' has not been declared

I am having issues compiling with this library with Arduino IDE 1.6.5.

The error given when trying to compile is:

In file included from temperature.pde:1:0:
C:\Users\Chris\Documents\Arduino\libraries\Sodaq_DS3231-master\src/Sodaq_DS3231.h:42:22: error: 'string' has not been declared
     void addToString(string & str) const;

Include the ability to let it set the time when compiling

Include the ability to let it set the time when compiling...
I generally would rather let the time be set automatically rather than manually. Perhaps include it as a commented option.

    rtc.adjust(DateTime(__DATE__, __TIME__));

// rtc.adjust(dt); //Adjust date-time as defined 'dt' above

Day of week error?

Surely 30/04/2020 is a Thursday. Using each of the examples with Due R3-E and RTC module gives a Friday as a day of the week.

"fatal error: avr/pgmspace.h: No such file or directory".

Trying to burn adafruit fona example to node MCU but getting error "fatal error: avr/pgmspace.h: No such file or directory". even tried In Sodaq_DS3231.cpp replacing
#include <avr\pgmspace.h>
with
#if (defined(AVR))
#include <avr\pgmspace.h>
#else #include <pgmspace.h>
#endif

"avr/pgmspace.h: No such file or directory" on ESP8266. Patch inside.

Hi!

I am using this library together with my NodeMCU and other ESP8266-12 modules.
But the library/compiler throws the following error: "fatal error: avr/pgmspace.h: No such file or directory".

I found the following solution:

In Sodaq_DS3231.cpp you have to replace

#include <avr\pgmspace.h>

with

#if (defined(__AVR__))
#include <avr\pgmspace.h>
#else
#include <pgmspace.h>
#endif

This works fine for me.

In file included from sketch\config/all.h:3:0,

Hi i'm trying to compile code in arduino
but the following error appear
and i don't now why
any solution please ??

Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from sketch\config/all.h:3:0,

Multiple libraries were found for "EEPROM.h"
Used: C:\Program
from C:\Users\ITzakria Bilal\Desktop\sonoffsc-master\esp8266\sonoffsc\sonoffsc.ino:27:

Not used: C:\Users\ITzakria
sketch\config/general.h:121:10: fatal error: pgmspace.h: No such file or directory

#include <pgmspace.h>

      ^~~~~~~~~~~~

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

Setting hh/mm/ss for interrupts does not work

Now, I'm not exactly a bit wizard myself, but apparently due to a bit mask error in the enableInterrupts-function in Sodaq_DS3231.cpp, the custom times newer trigger.

As explained in the DS3231 datasheet in table 2 on page 11, if comparing for example seconds, all other A1M-bits after the compared time unit are supposed to be set to 1. However in your code

//Enable HH/MM/SS interrupt on /INTA pin. All interrupts works like single-shot counter
void Sodaq_DS3231::enableInterrupts(uint8_t hh24, uint8_t mm, uint8_t ss)
{
    unsigned char ctReg=0;
    ctReg |= 0b00011101; 
    writeRegister(DS3231_CONTROL_REG, ctReg);     //CONTROL Register Address

    writeRegister(DS3231_AL1SEC_REG,  0b00000000 | bin2bcd(ss) ); //Clr AM1
    writeRegister(DS3231_AL1MIN_REG,  0b00000000 | bin2bcd(mm)); //Clr AM2
    writeRegister(DS3231_AL1HOUR_REG, (0b00000000 | (bin2bcd(hh24) & 0b10111111))); //Clr AM3
    writeRegister(DS3231_AL1WDAY_REG, 0b10000000 ); //set AM4
}

you don't set the trailing bits to 1 if I'm only setting seconds for example. This came around when I tried to call an interrupt every 10 seconds.

I know it's open source and that I could just fix it for you, but given your lack of a pulse in GH history and the number of other DS3231-libraries around, this issue is more of a warning sign for people who bother to check the page before trying to slap your lib on their duino.

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.