Skip to content

Instantly share code, notes, and snippets.

@kane-thornwyrd
Last active August 15, 2018 11:16
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 kane-thornwyrd/9f441842934d400cb20a8b95bc387e94 to your computer and use it in GitHub Desktop.
Save kane-thornwyrd/9f441842934d400cb20a8b95bc387e94 to your computer and use it in GitHub Desktop.
#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