Last active
August 15, 2018 11:16
-
-
Save kane-thornwyrd/9f441842934d400cb20a8b95bc387e94 to your computer and use it in GitHub Desktop.
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 <Wire.h> | |
#include "RTClib.h" // https://github.com/adafruit/RTClib | |
// https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/overview | |
// https://github.com/adafruit/RTClib/blob/master/examples/ds1307/ds1307.ino | |
RTC_DS1307 RTC; | |
void setup() { | |
pinMode(13, OUTPUT); | |
} | |
void loop() { | |
DateTime now = RTC.now(); | |
DateTime heureRTC; | |
uint8_t heureAlarme=8; | |
uint8_t minuteAlarme=23; | |
heureRTC = RTC1307.now(); | |
// Si l'heure courante est égale à l'heure d'alarme et si les minutes courantes sont égales aux minutes d'alarme | |
if (heureRTC.hour()==heureAlarme && heureRTC.minute()==minuteAlarme){ | |
// Envoyer un signal fort sur la pin 13 du arduino | |
digitalWrite(13,HIGH); | |
}else{ | |
digitalWrite(13,LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment