Skip to content

Instantly share code, notes, and snippets.

@ljmf00
Created January 29, 2022 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmf00/fa71e2db618dced5354a9ebdfdbde2e2 to your computer and use it in GitHub Desktop.
Save ljmf00/fa71e2db618dced5354a9ebdfdbde2e2 to your computer and use it in GitHub Desktop.
#define REL_PIN 12
#define LED_PIN 13
#define HOUR_MILIS (1000UL * 60 * 60)
#define ON_TIME_MILIS (1000UL * 60 * 20)
void setup() {
pinMode(REL_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
}
void loop() {
digitalWrite(REL_PIN, LOW);
delay(ON_TIME_MILIS);
digitalWrite(REL_PIN, HIGH);
//delay(HOUR_MILIS - ON_TIME_MILIS);
delay(ON_TIME_MILIS);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment