REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
front_panel_signaling.cpp
Go to the documentation of this file.
1#include <Arduino.h>
2
4#include "lucidac/lucidac.h"
5
6FLASHMEM void leds::set(uint8_t val) {
7 #ifdef ANABRID_PLATFORM_LUCIDAC
9 if(carrier_.front_panel) {
10 carrier_.front_panel->leds.set_all(val);
11 carrier_.front_panel->write_to_hardware();
12 }
13 #endif
14}
15
16FLASHMEM void leds::indicate_error() {
17 size_t num_blinks = 6;
18 for(size_t i=0; i<num_blinks; i++) {
19 leds::set(0x55);
20 delay(100);
21 leds::set(0xaa);
22 delay(100);
23 }
24 leds::set(0);
25}
26
27FLASHMEM void leds::ease_out() {
28 int val = 0xFF;
29 for(uint8_t i=0; i<8; i++) {
30 val /= 2; leds::set(val); delay(100);
31 }
32}
auto & carrier_
void indicate_error()
Flashing all LEDs Duration: 1.6sec blocking.
void ease_out()
Animation where all LEDs go off one by one Duration: 800ms blocking.
void set(uint8_t val)
Shorthand to set LEDs on LUCIDAC front panel.