Hey all, I’m a total noob with very little programming knowledge, but i’m working everyday to fix that. I have been playing for the last couple days on some small easy stuff and i’m now playing with the TimeAlarm, but can’t get my very simple code to work. Is any one able to look at this and tell me if it should work? Thanks
It does debug and flash correctly, I just cant see the led flash. I’m guessing it may have to do with time zone but i’m not sure.
// This #include statement was automatically added by the Spark IDE.
#include "TimeAlarms/TimeAlarms.h"
int led = D1; // This one is the built-in tiny one to the right of the USB jack
void setup()
{
Time.zone(-4); // UTC time -5 for central time
Alarm.alarmRepeat(8,31,0, BlinkledAlarm); //Testing first alarm at 8.31 am.. Blinkledalarm is the name of the alarm
pinMode(led, OUTPUT);
}
// Very simple blink function
void BlinkledAlarm() {
digitalWrite(led, HIGH);
delay(1000); // Turn ON the LED pins
digitalWrite(led, LOW);
delay(5000); // Turn OFF the LED pins
digitalWrite(led, HIGH);
delay(1000); // Turn ON the LED pins
}