whatnick / DS1682_Arduino

Demo Arduino code to test the DS1682 Grove module
4 stars 0 forks source link

resetElapsedTime() and resetEvents() not written to EEPROM #1

Open linwp opened 6 years ago

linwp commented 6 years ago

I've been trying to use the DS1682 as pulse counter and would like to reset the counter every now and then. Calling resetElapsedTime() and resetEvents() only resets the counter until the next pulse comes though. I guess that the EEPROM is never written with the reset value and the old value gets read from EEPROM again at a new pulse?

Example terminal output:

94 8 94 8 94 8 101 9 0 <-- Reset of Arduino 0 0 0 0 0 105 <-- New pulse event 9 0 10 106 10

linwp commented 6 years ago

Managed to resolve the issue. The reset functions have to be called while the event pin is high. Else it won't be written to EEPROM.