forked from W4D/soundcube-firmware
Codec working in bypass mode. I2S not working yet.
This commit is contained in:
@ -23,6 +23,8 @@ PWMAudio ui_snd(8);
|
||||
enum BUTTON {CVINL, CVINR, INL, INR, OUTR, OUTL, CVOUTR, CVOUTL, RIGHT, LEFT, SELECT, DEBUG1, DEBUG2, DEBUG3};
|
||||
|
||||
int lut_ring_cw[48] = {39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,50,49,48,47,46,45,44,43,42,41,40};
|
||||
int lut_ring_ccw[48] = {40,41,42,43,44,45,46,47,48,49,50,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};
|
||||
int lut_matrix[13] = {56,55,57,58,59,62,61,60,63,64,65,67,66};
|
||||
|
||||
CRGB ui_leds[74];
|
||||
CRGB edge_leds[11];
|
||||
@ -188,8 +190,8 @@ void loop() {
|
||||
position = ENC.getCumulativePosition();
|
||||
|
||||
sd_card_detected = !digitalRead(21);
|
||||
if(sd_card_detected) edge_leds[8] = CRGB(0,25,0);
|
||||
if(!sd_card_detected) edge_leds[8] = CRGB(25,0,0);
|
||||
if(sd_card_detected) edge_leds[8] = CRGB(0,10,0);
|
||||
if(!sd_card_detected) edge_leds[8] = CRGB(10,0,0);
|
||||
|
||||
// EDGE LEDs
|
||||
for (int i = 0; i < 8; i++) {
|
||||
@ -227,11 +229,6 @@ void loop() {
|
||||
click = true;
|
||||
}
|
||||
|
||||
// Flash led ring
|
||||
// for (int i = 0; i < 48; i++) {
|
||||
// ui_leds[i + 3] = CRGB(0, 15, 0);
|
||||
// }
|
||||
|
||||
// Flash encoder leds
|
||||
ui_leds[0] = CRGB(0, 100, 50);
|
||||
ui_leds[1] = CRGB(0, 100, 50);
|
||||
@ -246,25 +243,23 @@ void loop() {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
|
||||
// empty LED matrix
|
||||
for (int i = 0; i < 13; i++) {
|
||||
ui_leds[i + 3 + 48 + 4] = CRGB(0, 0, 0);
|
||||
ui_leds[lut_matrix[i]] = CRGB(0, 0, 0);
|
||||
}
|
||||
|
||||
// set active LED matrix LED
|
||||
ui_leds[active + 3 + 48 + 4] = CRGB(255, 255, 255);
|
||||
ui_leds[lut_matrix[active]] = CRGB(100, 100, 100);
|
||||
|
||||
if(position < 0) position += 4096;
|
||||
active_led_ring = (position / 32) % 48;
|
||||
|
||||
// set active LED ring LED
|
||||
for(int i = 0; i < active_led_ring; i++){
|
||||
ui_leds[lut_ring_cw[i]] = CRGB(50, 0, 25);
|
||||
ui_leds[lut_ring_ccw[i]] = CRGB(50, 0, 25);
|
||||
}
|
||||
|
||||
FastLED.show();
|
||||
|
||||
delay(1); // wait 1ms
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user