add offset

This commit is contained in:
interfisch 2020-12-14 22:50:46 +01:00
parent 30cfb7ffe7
commit c6b19b06e8
2 changed files with 9 additions and 3 deletions

View File

@ -19,6 +19,7 @@ build_flags =
lib_deps = lib_deps =
fastled/FastLED fastled/FastLED
[env:teensy31] [env:teensy31]
platform = teensy platform = teensy
board = teensy31 board = teensy31
@ -26,6 +27,7 @@ framework = arduino
build_flags = build_flags =
-D USB_SERIAL_HID -D USB_SERIAL_HID
-D PIN_DATA=0 -D PIN_DATA=0
-D LED_OFFSET=134
lib_deps = lib_deps =
fastled/FastLED fastled/FastLED

View File

@ -34,9 +34,9 @@
// --- General Settings // --- General Settings
const uint16_t const uint16_t
Num_Leds = 264; // strip length Num_Leds = 268; // strip length
const uint8_t const uint8_t
Brightness = 127; // maximum brightness Brightness = 255; // maximum brightness
// --- FastLED Setings // --- FastLED Setings
#if defined(SK6812RGBW) #if defined(SK6812RGBW)
@ -297,8 +297,12 @@ void dataMode(){
uint8_t w=calibW*whitecontent; uint8_t w=calibW*whitecontent;
int inew = i;
#ifdef LED_OFFSET
inew = (i+LED_OFFSET)%Num_Leds; //if offset defined, move led 1 around and wrap around at the end
#endif
send_leds[i] = CRGBW(r, g, b, w); //transfer to rgbw struct send_leds[inew] = CRGBW(r, g, b, w); //transfer to rgbw struct
} }
#endif #endif