// This example shows the use of EFFECT_CUSTOM_RC // This allows you to monitor the return code of the UpdateText() call // for more than just 0 or -1. It allows you to set a return code of 1-255 // when certain parts of the message reach the displayable area. #include #include #include #include // Change the next 6 defines to match your matrix type and size #define LED_PIN 2 #define COLOR_ORDER GRB #define CHIPSET WS2812B #define MATRIX_WIDTH 16 #define MATRIX_HEIGHT 16 #define MATRIX_TYPE HORIZONTAL_MATRIX cLEDMatrix leds; cLEDText DemoMsg; const unsigned char TxtDemo[] = { EFFECT_SCROLL_LEFT EFFECT_FRAME_RATE "\x00" EFFECT_BACKGND_ERASE EFFECT_COLR_EMPTY EFFECT_CUSTOM_RC "\x01" " HORIZONTAL " EFFECT_CUSTOM_RC "\x02" "VERTICAL " EFFECT_CUSTOM_RC "\x03" "DIAGONAL " }; void setup() { FastLED.addLeds(leds[0], leds.Size()); FastLED.setBrightness(255); FastLED.clear(true); delay(500); FastLED.showColor(CRGB::Red); delay(1000); FastLED.showColor(CRGB::Lime); delay(1000); FastLED.showColor(CRGB::Blue); delay(1000); FastLED.showColor(CRGB::White); delay(1000); FastLED.show(); DemoMsg.SetFont(RobotronFontData); DemoMsg.Init(&leds, leds.Width(), DemoMsg.FontHeight() + 1, 0, 0); DemoMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1); } void loop() { static uint8_t hue; static int Mode = 1; int16_t x, y; uint8_t h; int rc; h = hue; switch (Mode) { case 1: // ** Fill LED's with horizontal stripes for (y=0; y 0) Mode = rc; FastLED.show(); delay(20); }