Comments (10)
I see what you mean; you've done the correct thing by setting the alarm state to FALSE in the SetAlarm() method.
Looking at my code for the method isAlarm(), I don't check whether or not that bit is set. And since the 2 bits for the alarms keep their old values, this results in the problem you see.
I'm going to make some changes to the isAlarm() method in the library. I don't have a DS3231M handy to test my logic, can you check to see if it is now working?
from ds3231m.
I've made the changes to the isAlarm() method. Can you add that to your code and see if that correctly resolves the alarm problem?
from ds3231m.
Hi,
I try the new version, there is a problem, now the alarm is fire on every test : if (isAlarm() ...
like the isAlarm() is always true even with the clearAlarm()
from ds3231m.
That's not good :(
I will look at the code again; it sounds like I've mixed up some && and || conditions...
from ds3231m.
OK, now I think I've done it correctly, I also simplified the logic to
uint8_t controlByte = readByte(DS3231M_CONTROL) & 0x02; // Mask out all but last 2 bits for ALM1&2
uint8_t statusByte = readByte(DS3231M_STATUS) & 0x02; // Mask out all but last 2 bits for ALM1&2
The last two bits of both variables contain corresponding bits for "active" and "alarmed", so "and"ing them together will give either 0 for no alarms, or 0,1 and 2 (11b, 10b, 01b) for the alarm that is set.
from ds3231m.
Sorry, I didn't want to close this until you confirm that it is working.
from ds3231m.
hi,
I will do more test but for the first test it seem to work 👍
from ds3231m.
Excellent news. I've rechecked the datasheet and my programming logic and can't find a mistake. But I'll wait for your further testing before you or I close the ticket.
from ds3231m.
Hello
All tests i made are OK, i think you can close the case.
regards
from ds3231m.
That's good news. I think I'll draft a new version that incorporates this fix.
from ds3231m.
Related Issues (20)
- Doc example error ? HOT 1
- The SETDATE typed input fails due to the inputBuffer being shared (on Arduino Uno) HOT 2
- the bug of HOUR writing&reading HOT 4
- no way to tell whether the clock is set. HOT 1
- Reformat source code to clang-format HOT 1
- .adjust() not setting the correct time HOT 12
- DS3231 vs DS3231M HOT 7
- Make directory structure adhere to Arduino 1.5.x and later structure HOT 1
- Link to Maxim on wiki pages is broken HOT 1
- dayOfTheWeek() has incorrect range HOT 2
- Calculate leap year HOT 3
- STM32 cant upload again HOT 2
- Add support for 400KHz bus speed HOT 1
- Fix overflow on I2C speed definitions HOT 1
- Implement Travis-CI
- Update "SetAlarms.ino" to Doxygen-style comments and formatting HOT 1
- Change "Set.ino" to doxygen style comments and formatting HOT 1
- Change library source files to Doxygen-style comments and formatting HOT 1
- logic on pinAlarm and pinSquareWave are inverted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ds3231m.