From be3cd936d6b2e1ba133777e365c058df782a376f Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Thu, 29 Jun 2023 20:24:04 -0600 Subject: [PATCH] fixed import --- src/main.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f334c79..040cafe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -#include +#include "FAB_LED/FAB_LED.h" // Note that the platformio.ini file re-defines the serial rx buffer size. @@ -15,9 +15,8 @@ void setup() { strip.clear(NUM_LEDS); } -// !! IMPORTANT !! -// Make sure this is fast enough that it can -// clear the 64 byte buffer faster than it is filled! +// Don't spend too long in this function, we need to read out +// the serial buffer fairly quickly as to not loose data. void on_serial() { @@ -30,6 +29,9 @@ void on_serial() // the first, second, or third byte switch (read % 3) { + /* + Idk why it's weird like this RBG, but it's easier to change it here. + */ case 0: // first pixels[index].r = read_byte; break; @@ -45,6 +47,7 @@ void on_serial() if (read < BUF_SIZE-1) { read++; } else { + // Whole frame as been read, send to the leds strip.sendPixels(NUM_LEDS, pixels); read=0; } @@ -52,9 +55,8 @@ void on_serial() void loop() { - Serial.println(Serial.available()); if (Serial.available() > 0) { - // on_serial(); + on_serial(); } }