Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
default_behavior.hpp
Go to the documentation of this file.
1
5#ifndef DEFAULT_BEHAVIOR_MANAGER_HPP
6#define DEFAULT_BEHAVIOR_MANAGER_HPP
7
8//
9// note: this code is included as-is by:
10// - src/modes/user/indexable_behavior.hpp
11// - src/modes/user/simple_behavior.hpp
12//
13
14#include "src/system/component/time_handling.h"
15
16#include "src/system/bsp/ble.h"
17
21
22#include <cstdint>
23namespace lampda::user {
24
25//
26// These are defined in src/modes/user/{flavor}_behavior.hpp
27//
28
29bool button_clicked_default(const uint8_t);
30
31bool button_hold_default(const uint8_t, const bool, const uint32_t);
32
33//
34// These callbacks are the same for all lamp flavors*
35//
36
37// *meaning: LampTy is the one doing the "polyfill" between flavors
38
40{
41 auto manager = get_context();
42
43 // initialize the lamp object
44 manager.lamp.startup();
45
46 // callbacks
47 manager.power_on_sequence();
48}
49
51{
52 // callbacks
53 auto manager = get_context();
54 manager.power_off_sequence();
55
56 // clear lamp on power-off
57 manager.lamp.clear();
58 manager.lamp.show_now();
59
60 // (no-op) internal symbol used during build
61 ensure_build_canary();
62}
63
64void brightness_update(const brightness_t brightness)
65{
66 auto manager = get_context();
67
68 // dont handle invalid commands
69 if (brightness <= ::lampda::brightness::absoluteMaximumBrightness)
70 {
71 // force update of the internal references to the new brightness
72 // (the system saved brightness is only updated after this callback)
73 manager.lamp.align_internal_to_system_brightness(brightness);
74
75 // set brightness for underlying object (w/o re-entry in update_brightness)
76 manager.lamp.setBrightness(brightness, true, true);
77
78 // callbacks
79 manager.brightness_update(brightness);
80 }
81 else
82 {
83 // this call could be just a max brightness update
84 manager.lamp.enforce_internal_brightness_limits();
85 }
86}
87
89{
90 auto manager = get_context();
91 manager.write_parameters();
92}
93
95{
96 auto manager = get_context();
97 manager.read_parameters();
98}
99
100bool button_start_click_default(const uint8_t clicks) { return false; }
101
102bool button_start_hold_default(const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
103{
104 switch (clicks)
105 {
106 case 1:
107 {
108 // 1+hold (2s): activate bluetooth advertising
109 // activate bluetooth !
110 auto manager = get_context();
111
112 // ramp can activate bluetooth :
113 // - if it is not enabled yet
114 // - if it is enabled, but the bounded peer already exists (force open connection)
115
116 // Start pairing mode
117 const bool hasPairedDeviceAndNoPairing =
119 if (hasPairedDeviceAndNoPairing)
120 {
121 if (manager.overlay_animate_ramp(
122 holdDuration, 1000, modes::colors::PaletteGradient<modes::colors::Blue, modes::colors::Blue>))
123 {
124 // Start BLE but with paired device authorization only
126
127 bsp::lampda_print("Enable BLE for paired device");
128 }
129 }
130 // else: not bounded, or already started bounded connection, or a device is connected
131 else
132 {
133 // Start pairing mode. A connected device is disconnected, to force a new pairing
134 const bool isNotCurrentlyPairing = not(bsp::ble::is_advertising() and bsp::ble::is_open_to_all());
135 if (isNotCurrentlyPairing and
136 manager.overlay_animate_ramp(
137 holdDuration, 3000, modes::colors::PaletteGradient<modes::colors::Blue, modes::colors::Blue>))
138 {
139 // Start pairing mode
141
142 bsp::lampda_print("Enable BLE pairing mode");
143 }
144 }
145 return true;
146 }
147 }
148
149 // sunset timer, on its configured clicks
151 not isEndOfHoldEvent and holdDuration > 0)
152 {
153 auto manager = get_context();
154 if (manager.overlay_animate_ramp(
155 holdDuration, 1000, modes::colors::PaletteGradient<modes::colors::White, modes::colors::Red>))
156 {
157 // update the sunset timing
158 manager.state.isSunsetTimingPending = 2;
159 }
160
161 return true;
162 }
163
164 return false;
165}
166
167bool button_clicked_usermode(const uint8_t clicks)
168{
169 auto manager = get_context();
170 return manager.custom_click(clicks);
171}
172
173bool button_hold_usermode(const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
174{
175 auto manager = get_context();
176 return manager.custom_hold(clicks, isEndOfHoldEvent, holdDuration);
177}
178
179void loop()
180{
181 auto manager = get_context();
182 manager.loop();
183
184 // signal display update every loop
185 manager.lamp.signal_display();
186}
187
189{
190#ifdef LMBD_LAMP_TYPE__INDEXABLE
192 return true;
193#else
194 auto manager = get_context();
195 return manager.should_spawn_thread();
196#endif
197}
198
200{
201 auto manager = get_context();
202 manager.lamp.show();
203
204 if (manager.should_spawn_thread())
205 manager.user_thread();
206}
207
209namespace default_behaviors {
210
212bool button_clicked(const uint8_t clicks)
213{
214 auto manager = get_context();
215
216 // quick navigation: jump to first mode of first category
218 {
219 // exit fav group if needed
220 manager.exit_favorite_group(manager.state.beforeFavoriteActiveIndex);
221
222 // return to first state
223 manager.set_active_group(0);
224 manager.set_active_mode(0);
225 // ramps will be updated on their own
226
227 // Blip for state change
228 manager.blip(250);
229
230 return true;
231 }
232
233 // nothing
234 return false;
235}
236
238bool button_hold(const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
239{
240 auto manager = get_context();
241 auto& rampHandler = manager.state.rampHandler;
242
243 // Add 5 minutes to sunset timer, on its configured clicks
245 not isEndOfHoldEvent and holdDuration > 0 and logic::sunset_timer.is_enabled())
246 {
247 if (manager.overlay_animate_ramp(
248 holdDuration, 1000, modes::colors::PaletteGradient<modes::colors::White, modes::colors::Red>))
249 {
250 // update the sunset timing
251 manager.state.isSunsetTimingPending = 2;
252 }
253 }
254
255 // configure custom ramp, on its configured clicks. No ramps in favorite group
257 not manager.state.isInFavoriteMockGroup)
258 {
259 rampHandler.update_ramp(manager.get_active_custom_ramp(), holdDuration, [&](uint8_t rampValue) {
260 manager.custom_ramp_update(rampValue);
261 manager.set_active_custom_ramp(rampValue);
262 });
263 return true;
264 }
265
266 switch (clicks)
267 {
268 case 13: // 13 clicks + hold: reset the stored parameters
269 {
270 if (not isEndOfHoldEvent and holdDuration > 0)
271 {
272 auto manager = get_context();
273 if (manager.overlay_animate_ramp(
274 holdDuration, 5000, modes::colors::PaletteGradient<modes::colors::Red, modes::colors::Red>))
275 {
276 bsp::lampda_print("clearing user parameters");
277
278 // reset the file system and memory
280 }
281 }
282 break;
283 }
284
285 case 20: // 20 clicks + hold: reset the whole system and stored parameters
286 {
287 if (not isEndOfHoldEvent and holdDuration > 0)
288 {
289 auto manager = get_context();
290 if (manager.overlay_animate_ramp(
291 holdDuration, 5000, modes::colors::PaletteGradient<modes::colors::Red, modes::colors::Red>))
292 {
293 // reset the file system and memory
294 bsp::lampda_print("clearing the whole file format");
296
297 // shutdown the lamp
298 logic::behavior::internal::handle_shutdown_state();
299 }
300 }
301 break;
302 }
303 }
304
305 return false;
306}
307
308namespace __private {
309
311void handle_brightness_control(const brightness_t requiredbrightness)
312{
313 // ignore if not on
315 return;
316
317 logic::sun_timers_brightness_lock_all(true);
318 // update brightness
319 const brightness_t desiredBrightness =
320 min<brightness_t>(::lampda::brightness::absoluteMaximumBrightness, requiredbrightness);
321 // Update the system brightness for real, not the temporary. We want the changes to be saved
322 logic::brightness::update_brightness(desiredBrightness);
323 // update saved brightness
325 logic::sun_timers_brightness_lock_all(false);
326
327 // and change the sunset timer if needed
329}
330
332void handle_on_off_command(const bool shouldBeOn)
333{
334 // turn on
335 if (shouldBeOn)
336 {
339 }
340 // turn off
341 else
342 {
345 }
346}
347
352void handle_ramp_command(const uint8_t ramp)
353{
354 // ignore if not on
356 return;
357
358 auto manager = get_context();
359
360 // update ramp value in modes
361 manager.custom_ramp_update(ramp, 1000);
362 // override user choice
363 manager.set_active_custom_ramp(ramp);
364}
365
370{
371 if (not time.is_valid())
372 {
373 bsp::lampda_print("Refusing set_time command %d %dh %dm %ds. Invalid values.",
374 time.dayOfTheWeek,
375 time.hour,
376 time.minutes,
377 time.seconds);
378 return;
379 }
380 const bool isValid = component::time::set_real_time(time);
382 "set time %d %dh %dm %ds (validity: %d)", time.dayOfTheWeek, time.hour, time.minutes, time.seconds, isValid);
383}
384
389{
390 if (not time.is_valid())
391 {
392 bsp::lampda_print("Refusing sunset command %d %dh %dm %ds. Invalid values.",
393 time.dayOfTheWeek,
394 time.hour,
395 time.minutes,
396 time.seconds);
397 return;
398 }
399 const auto& realTime = component::time::get_real_time();
400 if (not realTime.is_valid())
401 {
402 bsp::lampda_print("Refusing sunset command %d %dh %dm %ds : Time is not synchronized yet.",
403 time.dayOfTheWeek,
404 time.hour,
405 time.minutes,
406 time.seconds);
407 return;
408 }
409
410 const uint32_t internalLampActionTime = component::time::get_platform_time_from_target_time(time);
411 if (internalLampActionTime <= 0)
412 {
413 bsp::lampda_print("Refusing sunset command %d %dh %dm %ds: Target time is incoherent",
414 time.dayOfTheWeek,
415 time.hour,
416 time.minutes,
417 time.seconds);
418 return;
419 }
420
421 // lamp will turn on if not already turned on
424
425 logic::sunset_timer.set_deadline(internalLampActionTime);
426}
427
432{
433 if (not time.is_valid())
434 {
435 bsp::lampda_print("Refusing sunrise command %d %dh %dm %ds. Invalid values.",
436 time.dayOfTheWeek,
437 time.hour,
438 time.minutes,
439 time.seconds);
440 return;
441 }
442 const auto& realTime = component::time::get_real_time();
443 if (not realTime.is_valid())
444 {
445 bsp::lampda_print("Refusing sunrise command %d %dh %dm %ds : Time is not synchronized yet.",
446 time.dayOfTheWeek,
447 time.hour,
448 time.minutes,
449 time.seconds);
450 return;
451 }
452
453 const uint32_t internalLampActionTime = component::time::get_platform_time_from_target_time(time);
454 if (internalLampActionTime <= 0)
455 {
456 bsp::lampda_print("Refusing sunrise command %d %dh %dm %ds: Target time is incoherent",
457 time.dayOfTheWeek,
458 time.hour,
459 time.minutes,
460 time.seconds);
461 return;
462 }
463
464 logic::sunrise_timer.set_deadline(internalLampActionTime);
465}
466
467void handle_mode_control(const uint8_t groupIndex, const uint8_t modeIndex)
468{
469 // lamp will turn on if not already turned on
472
473 auto manager = get_context();
474
475 if (groupIndex >= manager.get_groups_count())
476 {
477 bsp::lampda_print("Group id %d is greater than max group id %d", groupIndex, manager.get_groups_count());
478 return;
479 }
480
481 modes::ActiveIndexTy index {groupIndex, modeIndex, 0, 0};
482 manager.jump_to_new_active_index(index, true, true); // ignore saved index AND quit favorite mode
483
484 if (modeIndex >= manager.get_modes_count())
485 {
486 bsp::lampda_print("Mode id %d is greater than max mode id %d", modeIndex, manager.get_modes_count());
487 manager.set_active_mode(manager.get_modes_count() - 1);
488 return;
489 }
490
491 manager.blip(250);
492}
493
494} // namespace __private
495
496bool handle_user_command(const common::UserCommand& command)
497{
498 switch (command.get_type())
499 {
501 {
502 uint8_t ramp;
503 if (command.parse_ramp(ramp))
504 __private::handle_ramp_command(ramp);
505 else
506 bsp::lampda_print("Failed to parse set_user_ramp command");
507 return true;
508 }
510 {
511 brightness_t brgt;
512 if (command.parse_brightness(brgt))
513 __private::handle_brightness_control(brgt);
514 else
515 bsp::lampda_print("Failed to parse brightness command");
516 return true;
517 }
519 {
520 uint8_t groupId;
521 uint8_t modeId;
522 if (command.parse_set_mode(groupId, modeId))
523 __private::handle_mode_control(groupId, modeId);
524 else
525 bsp::lampda_print("Failed to parse set_mode command");
526 return true;
527 }
529 {
530 bool shouldTurnOn;
531 if (command.parse_turn_onoff(shouldTurnOn))
532 __private::handle_on_off_command(shouldTurnOn);
533 else
534 bsp::lampda_print("Failed to parse onoff command");
535 return true;
536 }
538 {
539 component::time::RealTime time;
540 if (command.parse_set_real_time_command(time))
541 __private::handle_set_time_command(time);
542 else
543 bsp::lampda_print("Failed to parse set_real_time command");
544 return true;
545 }
547 {
548 component::time::RealTime time;
549 if (command.parse_set_sunset_to_time_command(time))
550 __private::handle_sunset_to_time_command(time);
551 else
552 bsp::lampda_print("Failed to parse set_sunset_time command");
553 return true;
554 }
556 {
557 component::time::RealTime time;
558 if (command.parse_set_sunrise_to_time_command(time))
559 __private::handle_sunrise_to_time_command(time);
560 else
561 bsp::lampda_print("Failed to parse set_sunrise_time command");
562 return true;
563 }
564
566 {
567 float progress;
568 if (command.parse_signal_sunset_progress_command(progress))
569 get_context().sunset_update(progress);
570 else
571 bsp::lampda_print("Failed to parse signal_sunset_progress command");
572 return true;
573 }
575 {
576 float progress;
577 if (command.parse_signal_sunrise_progress_command(progress))
578 get_context().sunrise_update(progress);
579 else
580 bsp::lampda_print("Failed to parse signal_sunrise_progress command");
581 return true;
582 }
584 {
585 if (command.parse_signal_suntimer_cancel_command())
586 {
587 auto manager = get_context();
588 manager.sunset_timer_internal_reset();
589 manager.sunrise_timer_internal_reset();
590 }
591 else
592 bsp::lampda_print("Failed to parse signal_suntimer_cancel command");
593 return true;
594 }
596 {
597 bool isSunrise;
598 if (command.parse_disable_sun_timer_command(isSunrise))
599 {
600 if (isSunrise)
601 {
602 // keep the brightness reached by the sunrise, as for a user brightness change
603 logic::sunrise_timer.cancel_at_current_brightness();
604 bsp::lampda_print("Sunrise timer disabled");
605 }
606 else
607 {
609 bsp::lampda_print("Sunset timer disabled");
610 }
611 }
612 else
613 bsp::lampda_print("Failed to parse disable_sun_timer command");
614 return true;
615 }
617 {
618 uint8_t sensitivity;
619 if (command.parse_set_mic_sensitivity_command(sensitivity))
621 else
622 bsp::lampda_print("Failed to parse set_mic_sensitivity command");
623 return true;
624 }
626 {
627 uint32_t duration_ms;
628 if (command.parse_blip_output_command(duration_ms))
629 {
630 auto manager = get_context();
631 // skipped if a blip is running: it would replace its remaining time
632 if (manager.state.skipNextFrameEffect == 0)
633 manager.blip(duration_ms);
634 }
635 else
636 bsp::lampda_print("Failed to parse blip_output command");
637 return true;
638 }
640 {
641 if (command.parse_print_status_command())
642 {
644 {
645 bsp::lampda_print_raw("$stat:OFF\r\n");
646 }
647 else
648 {
649 auto manager = get_context();
650 // single line, easy to parse by an external app: $stat:<group>:<mode>:<ramp>:<brightness>:<F|->
651 bsp::lampda_print_raw("$stat:g%u:m%u:r%u:%c brgt:%u\r\n",
652 manager.get_active_group(),
653 manager.get_active_mode(),
654 manager.get_active_custom_ramp(),
655 manager.state.isInFavoriteMockGroup ? 'F' : 'X',
657 }
658 }
659 else
660 bsp::lampda_print("Failed to parse print_status command");
661 return true;
662 }
664 {
665 if (command.parse_print_favorites_command())
666 {
667 auto manager = get_context();
668 bsp::lampda_print("favorites set: %u (max %u), in favorite group: %s",
669 manager.state.usedFavoriteCount,
670 manager.state.maxFavoriteCount,
671 manager.state.isInFavoriteMockGroup ? "true" : "false");
672 }
673 else
674 bsp::lampda_print("Failed to parse print_favorites command");
675 return true;
676 }
677
678 default:
679 break;
680 }
681 return false;
682}
683
684} // namespace default_behaviors
685
686} // namespace lampda::user
687
688#endif
Handle the output LED strip brightness.
Usage interface for the bluetooth system.
User configurable links between click counts and default behaviors.
@ SetSunsetToTime
set the sunset to a target real time
@ SignalSunriseProgress
Signal a sunrise update event.
@ PrintStatus
Print the current mode, group, ramp, brightness and favorite state on one line.
@ SetRealTime
set the system real time
@ PrintFavorites
Print the favorite mode count.
@ DisableSunTimer
Disable the sunset or the sunrise timer.
@ BlipOutput
Turn off the output for a short time.
@ SetMicSensitivity
Set the microphone sensitivity.
@ SignalSunsetProgress
Signal a sunset update event.
@ SignalSuntimerCancel
Signal that a suntimer was canceled.
@ SetUserRamp
set the user ramp value
@ SetSunriseToTime
set the sunrise to a target real time
bool cancel()
Cancel the current active timer.
Definition: sun_timers.cpp:20
void set_deadline(const uint32_t timeshutdown_s)
Start the sun timer with a deadline, or prolonge the current sun timer.
Definition: sun_timers.cpp:51
void bump_timer()
signal to the timer that some time may be added. Only add time if the timer is in the fadeout phase
Definition: sun_timers.cpp:254
void clear(const Type type)
Clear an alert.
Definition: alerts.cpp:1063
void handle_sunset_to_time_command(const component::time::RealTime &time)
Handle the timing command.
Definition: default_behavior.hpp:388
void handle_on_off_command(const bool shouldBeOn)
handle the On or Off command
Definition: default_behavior.hpp:332
void handle_brightness_control(const brightness_t requiredbrightness)
handle the brightness command
Definition: default_behavior.hpp:311
void handle_set_time_command(const component::time::RealTime &time)
Handle the set time command.
Definition: default_behavior.hpp:369
void handle_sunrise_to_time_command(const component::time::RealTime &time)
Handle the timing command.
Definition: default_behavior.hpp:431
void handle_ramp_command(const uint8_t ramp)
Handle the ramp command.
Definition: default_behavior.hpp:352
bool is_connected()
Return true if a bluetooth user is connected.
Definition: ble.cpp:427
void force_pairing_mode()
Start the pairing mode (open to all devices), even if a device is connected. The connected device is ...
Definition: ble.cpp:538
bool is_advertising()
Return true is the bluetooth is visible by other devices.
Definition: ble.cpp:423
bool is_open_to_all()
Return true if the device is advertising, and all can connect.
Definition: ble.cpp:425
bool is_bounded()
Return true if the bluetooth connection is bounded to a pair.
Definition: ble.cpp:429
void start_advertising(bool allowUnknownConnections)
start the advertising sequence (with a timeout)
Definition: ble.cpp:492
bool format()
Delete the user file.
Definition: filesystem.cpp:372
void clear_internal_fs()
hard clean of the whole filesystem, you will loose all stored data.
Definition: filesystem.cpp:65
void lampda_print(const char *format,...)
C linkage to print functions.
Definition: text_out.cpp:336
void lampda_print_raw(const char *format,...)
C linkage to print functions.
Definition: text_out.cpp:320
void set_sensitivity(const uint8_t sensitivity)
Set the microphone sensitivity, applied as a gain on the raw samples (FFT, sound level and auto gain ...
Definition: sound.cpp:47
uint32_t get_platform_time_from_target_time(const RealTime &time)
Given a real time, return the expected platform time in seconds at wich it will be reached....
Definition: time_handling.cpp:98
RealTime get_real_time()
Return a real time value, only valid if it was set first.
Definition: time_handling.cpp:96
bool set_real_time(const RealTime &realTime)
Set the real time in the lamp, only valid until the next shutdown.
Definition: time_handling.cpp:75
AlertManager_t manager
Instanciation of the AlertManager.
Definition: alerts.cpp:30
void set_power_on()
set system state to "output on"
Definition: behavior.cpp:142
void set_power_off()
set system state to "output off". Can be ignored
Definition: behavior.cpp:143
bool is_in_output_state()
return true if the system is in output mode
Definition: behavior.cpp:156
brightness_t get_brightness()
Return the current brightness value.
Definition: brightness_handle.cpp:42
void update_brightness(const brightness_t newBrightness, const bool shouldSkipUserCallbacks)
update the internal brightness values
Definition: brightness_handle.cpp:73
void update_saved_brightness()
Update the saved brightness value with the current brightness.
Definition: brightness_handle.cpp:61
Behavior get_click_behavior(const uint8_t clicks)
Return the behavior whose click action is linked to this click count, or Behavior::None.
Definition: button_bindings.cpp:103
@ QuickNavigation
click: jump to the first mode
@ Sunset
hold: start or extend the sunset timer
@ CustomRamp
hold: configure the custom ramp of the mode
Behavior get_hold_behavior(const uint8_t clicks)
Return the behavior whose hold action is linked to this click count, or Behavior::None.
Definition: button_bindings.cpp:114
SunsetTimer sunset_timer
object to access to control the timers
Definition: sun_timers.cpp:237
bool button_hold(const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
must be called by the lampda::user::button_hold_default
Definition: default_behavior.hpp:238
bool button_clicked(const uint8_t clicks)
must be called by the lampda::user::button_clicked_default
Definition: default_behavior.hpp:212
Contains code handling custom user mode functions for indexable strips.
Definition: default_behavior.hpp:23
bool button_clicked_default(const uint8_t)
Called to handle button click events for default user mode behaviors.
Definition: indexable_behavior.hpp:20
bool button_hold_default(const uint8_t, const bool, const uint32_t)
Called to handle button click+hold events for user mode behaviors.
Definition: indexable_behavior.hpp:166
void brightness_update(const brightness_t brightness)
Called when the system changes the LED strip brightness.
Definition: default_behavior.hpp:64
void user_thread()
Called at each tick of the secondary thread.
Definition: default_behavior.hpp:199
bool button_hold_usermode(const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
Called to handle button click+hold events if "usermode UI" is on.
Definition: default_behavior.hpp:173
bool button_start_hold_default(const uint8_t clicks, const bool isEndOfHoldEvent, const uint32_t holdDuration)
Called to handle button hold on lamp start.
Definition: default_behavior.hpp:102
void read_parameters()
Called when system wants to read parameters from filesystem.
Definition: default_behavior.hpp:94
void power_on_sequence()
Called when the system powers on (must be non blocking function!)
Definition: default_behavior.hpp:39
bool button_start_click_default(const uint8_t clicks)
Called to handle button click on lamp start.
Definition: default_behavior.hpp:100
bool should_spawn_thread()
Determine if a second user_thread() loop thread should be spawned.
Definition: default_behavior.hpp:188
void write_parameters()
Called when system wants to write parameters to filesystem.
Definition: default_behavior.hpp:88
void power_off_sequence()
Called when the system powers off (must be non blocking function!)
Definition: default_behavior.hpp:50
void loop()
Called at each tick of the main loop.
Definition: default_behavior.hpp:179
bool button_clicked_usermode(const uint8_t clicks)
Called to handle button click events if "usermode UI" is active.
Definition: default_behavior.hpp:167
uint16_t brightness_t
Define the type of the brightness parameters.
Definition: constants.h:151
Interface for the physical components of the microphone.
Store a real time reference.
Definition: time_handling.h:18
uint8_t minutes
minutes, in the [0; 59]
Definition: time_handling.h:30
uint8_t dayOfTheWeek
[0; 6] the index of the day of the week. Monday is 0, sunday is 6
Definition: time_handling.h:28
uint8_t hour
hour of the day, in the [0; 23]
Definition: time_handling.h:29
uint8_t seconds
seconds, in the [0; 59]
Definition: time_handling.h:31