-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathledpie_for_jeff.cpp
More file actions
39 lines (30 loc) · 1.1 KB
/
ledpie_for_jeff.cpp
File metadata and controls
39 lines (30 loc) · 1.1 KB
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
#include <matrix_hal/everloop.h>
#include <matrix_hal/everloop_image.h>
#include <matrix_hal/matrixio_bus.h>
namespace hal = matrix_hal;
// Everloop Initialization
hal::MatrixIOBus bus;
if (!bus.Init()) return false;
hal::EverloopImage image1d(bus.MatrixLeds());
hal::Everloop everloop;
everloop.Setup(&bus);
// Clear all LEDs
for (hal::LedValue &led : image1d.leds) {
led.red = 0;
led.green = 0;
led.blue = 0;
led.white = 0;
}
everloop.Write(&image1d);
for (int i = 0; i < num_participants; i++) {
// Convert from angle to pots index
int brightness = (participant[i].talking) ? MAX_BRIGHTNESS : 0;
image1d.leds[participant[i].led_num].red = brightness * colour[i].red;
image1d.leds[participant[i].led_num].green = brightness * colour[i].green;
image1d.leds[participant[i].led_num].blue = brightness * colour[i].blue;
image1d.leds[participant[i].led_num].white = 0;
//printf ("led %d index %d person %d brightness %d \n", i,index_pots, position_person_number[index_pots],brightness);
}
everloop.Write(&image1d);
}
}