From ec44b9335f4f63fdfebc19e2fefb58150830bd17 Mon Sep 17 00:00:00 2001 From: David Madison Date: Fri, 5 May 2017 05:40:40 -0400 Subject: [PATCH] Added DEBUG_FPS macro --- Arduino/LEDstream_FastLED/LEDstream_FastLED.ino | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino index f4c4d1b..524018a 100644 --- a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino +++ b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino @@ -30,6 +30,7 @@ static const unsigned long // --- Debug Settings (uncomment to add) //#define DEBUG_LED 13 // toggles the Arduino's built-in LED on header match +//#define DEBUG_FPS 8 // enables a pulse on LED latch // -------------------------------------------------------------------- @@ -64,7 +65,7 @@ static const uint8_t magic[] = { #define MODE_HEADER 0 #define MODE_DATA 1 -// Debug statement initialized +// Debug macros initialized #ifdef DEBUG_LED #define ON 1 #define OFF 0 @@ -74,6 +75,12 @@ static const uint8_t magic[] = { #define D_LED(x) #endif +#ifdef DEBUG_FPS + #define D_FPS do {digitalWrite(DEBUG_FPS, HIGH); digitalWrite(DEBUG_FPS, LOW);} while (0) +#else + #define D_FPS +#endif + void setup(){ #ifdef GROUND_PIN pinMode(GROUND_PIN, OUTPUT); @@ -85,6 +92,10 @@ void setup(){ digitalWrite(DEBUG_LED, LOW); #endif + #ifdef DEBUG_FPS + pinMode(DEBUG_FPS, OUTPUT); + #endif + FastLED.addLeds(leds, Num_Leds); FastLED.setBrightness(Brightness); @@ -187,6 +198,7 @@ void adalight(){ // End of data -- issue latch: mode = MODE_HEADER; // Begin next header search FastLED.show(); + D_FPS; D_LED(OFF); } break;