This file has been truncated. show original
** Library provides tools to set daily timers for control of devices such as lamps, appliances, etc. Developed primarilary for houshold presence simulation.
** Allows for setting ON and OFF times, days of the week (i.e. weekends, weekdays, Fridays) and the use of random on/off times using this Constructor:
DailyTimer myTimer( START_HOUR, START_MINUTE, END_HOUR, END_MINUTE, DAYS_OF_WEEK, RANDOM or FIXED)
** Timers may bridge midnight, simply enter times accordingly:
DailyTimer myTimer( 18, 30, 1, 45, WEEKENDS, FIXED); // starts at 6:30pm Saturdays and Sundays and ends at 1:45am the next day.
** Automatically sets correct timer state on powerup, using isActive() in loop(), see example below.
** Random start and/or end times using this member function:
myTimer.setRandomOffset(30, RANDOM_START); // Can be RANDOM_START, RANDOM_END, or both (RANDOM) default random offfset is 15min
** Random days of week using this member function:
myTimer.setRandomDays(4); // will select four days of the week, randomly. Useful to run this member function once a week, for example.
** Select custom days of the week using this member function:
myTimer.setDaysActive(0b10101010); // e.g.Sunday, Tuesday, Thursday and Saturday Note: Days in this order: 0bSMTWTFS0 <- LSB is zero