This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DS3232RTC.h> | |
#include <LowPower.h> | |
// pin definitions | |
const int SQW_PIN = 2; | |
const int BUTTON_PIN = 3; | |
const int LED_PIN = 8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Arduino DS3232RTC Library | |
// https://github.com/JChristensen/DS3232RTC | |
// | |
// Example sketch illustrating Time library with Real Time Clock. | |
// This example is identical to the example provided with the Time Library, | |
// only the #include statement has been changed to include the DS3232RTC library. | |
#include <DS3232RTC.h> // https://github.com/JChristensen/DS3232RTC | |
#include <LowPower.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LowPower.h> | |
// Define our physical setup | |
const int HAVE_FED_PIN = 2; | |
const int EARLIER_PIN = 3; | |
const int LED_PIN = 8; | |
// Declare some state-tracking variables | |
int haveFedButtonPressed = 0; | |
int alertSoonerButtonPressed = 0; | |
boolean alertSoonerButtonActive = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LowPower.h> | |
// Define our physical setup | |
const int HAVE_FED_PIN = 2; | |
const int EARLIER_PIN = 3; | |
const int LED_PIN = 8; | |
// Declare some state-tracking variables | |
int haveFedButtonPressed = 0; | |
int alertSoonerButtonPressed = 0; | |
boolean alertSoonerButtonActive = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned long previous = 0; | |
// Set this to the desired delay in ms | |
const unsigned long DELAY; | |
void loop() { unsigned long now = millis(); | |
if (now - previous > DELAY) { | |
// Fire our event | |
previous = now; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define our physical setup | |
const int EARLIER_PIN = 13; | |
const int LED_PIN = 8; | |
const int HAVE_FED_PIN = 2; | |
// Define some configuration | |
// The "units" of our program | |
#define SECONDS 1000 | |
#define HOURS 3600000 | |
// Seconds for testing |