@@ -36,10 +36,19 @@ void setup() {
36
36
ArduinoCloud.printDebugInfo ();
37
37
38
38
/* Configure a schedule for LED. This should be done with Arduino create Scheduler widget */
39
- unsigned int startingFrom = 1635786000 ; /* From 01/11/2021 17:00 */
40
- unsigned int untilTo = startingFrom + ( DAYS * 28 ); /* To 29/11/2021 17:00 */
41
- unsigned int executionPeriod = MINUTES * 6 ; /* For 6 minutes */
42
- unsigned int scheduleConfiguration = 134217770 ; /* On monday wednesday and friday */
39
+ unsigned int startingFrom = Schedule::getTimeFromString (" 2021 Nov 01 17:00:00" ); /* From 01/11/2021 17:00 */
40
+ unsigned int untilTo = startingFrom + ( DAYS * 28 ); /* To 29/11/2021 17:00 */
41
+ unsigned int executionPeriod = MINUTES * 6 ; /* For 6 minutes */
42
+ ScheduleWeeklyMask WeeklyMask = {
43
+ ScheduleState::Inactive, /* Sunday -> Inactive */
44
+ ScheduleState::Active, /* Monday -> Active */
45
+ ScheduleState::Inactive, /* Tuesday -> Inactive */
46
+ ScheduleState::Active, /* Wednesday -> Active */
47
+ ScheduleState::Inactive, /* Thursday -> Inactive */
48
+ ScheduleState::Active, /* Friday -> Active */
49
+ ScheduleState::Inactive, /* Saturday -> Inactive */
50
+ };
51
+ unsigned int scheduleConfiguration = Schedule::createWeeklyScheduleConfiguration (WeeklyMask);
43
52
44
53
led = Schedule (startingFrom, untilTo, executionPeriod, scheduleConfiguration);
45
54
}
0 commit comments