-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbcm_data_direction.ino
72 lines (55 loc) · 1.68 KB
/
bcm_data_direction.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <ArduinoSTL.h>
#include <EEPROM.h>
#include "led_ring.h"
#include "storage.h"
#include "communication.h"
uint8_t cue_index = 0;
using namespace freilite::iris;
void setup()
{
#if 0
Cue new_cue= Cue();
new_cue.ramp_type = RampType::linearRGB;
new_cue.start_color = {255, 255, 255};
new_cue.end_color = {0, 0, 0};
storage::push_cue(new_cue);
storage::push_schedule(delay_t(delimiter_flag_t::schedule, 0));
new_cue = Cue();
new_cue.duration = 500;
new_cue.ramp_parameter = 250;
new_cue.ramp_type = RampType::jump;
new_cue.time_divisor = 6;
new_cue.reverse = true;
new_cue.start_color = {255, 50, 0};
new_cue.end_color = {0, 50, 255};
storage::push_cue(new_cue);
storage::push_schedule(delay_t(delimiter_flag_t::schedule, 1));
new_cue = Cue();
new_cue.duration = 2000;
new_cue.ramp_parameter = 1000;
new_cue.ramp_type = RampType::linearRGB;
new_cue.start_color = {0x00, 0xF3, 0xF3};
new_cue.end_color = {0xEE, 0xF3, 0x00};
storage::push_cue(new_cue);
storage::push_schedule(delay_t(delimiter_flag_t::schedule, 2));
storage::store_all_in_eeprom();
#else
storage::load_all_from_eeprom();
#endif
SerialUSB.begin(9600);
led_ring::init();
}
//Delay in ms after which to repeat the main loop
const uint16_t LOOP_DELAY = 20;
void loop()
{
communication::handle_serial_io();
if(millis() % 3000 <= LOOP_DELAY){
cue_index = (cue_index + 1) % storage::number_of_cues();
}
//led_ring::print_debug_info();
led_ring::reset_counters();
//led_ring::draw_cue(cue_index, millis());
led_ring::draw_schedule(cue_index, millis());
delay(LOOP_DELAY);
}