Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #include <LEDMatrix.h>
- #include <LEDText.h>
- #include <Font12x16.h>
- // Change the next 6 defines to match your matrix type and size
- #define LED_PIN 7
- #define LED_PIN2 8
- #define COLOR_ORDER GRB
- #define CHIPSET WS2812B
- #define BRIGHTNESS 40
- #define MATRIX_WIDTH 12
- #define MATRIX_HEIGHT 46
- #define MATRIX_TYPE VERTICAL_ZIGZAG_MATRIX
- cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;
- cLEDText ScrollingMsg;
- void Init( uint16_t = MATRIX_WIDTH, uint16_t = MATRIX_HEIGHT, int16_t OriginX = 0, int16_t OriginY = 0);
- const unsigned char AweSome[] = { EFFECT_FRAME_RATE "\x02"
- EFFECT_SCROLL_UP " EVERYTHING"
- //EFFECT_RGB "0, 100, 255"
- };
- const unsigned char WelCome[] = { EFFECT_FRAME_RATE "\x02"
- EFFECT_SCROLL_UP " HELLO WORLD"
- //EFFECT_HSV_AH "\x00\xff\xff"
- EFFECT_DELAY_FRAMES "\01\x00"
- };
- uint16_t Options;
- void setup()
- {
- FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());
- FastLED.setBrightness(BRIGHTNESS);
- 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();
- ScrollingMsg.SetFont(Font12x16Data);
- //ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight() + 30, 0, 2); //offsset top distance to 14 Begin, letters at 2 pixels in
- ScrollingMsg.Init(&leds, leds.Width(), leds.Height() + 14, 0, 0);
- ScrollingMsg.SetText((unsigned char *)AweSome, sizeof(AweSome) - 1);
- // ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 200, 0, 255);
- }
- void loop()
- {
- if (ScrollingMsg.UpdateText() == -1)
- {
- ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 200, 0, 255);
- ScrollingMsg.SetText((unsigned char *)AweSome, sizeof(AweSome) - 1);
- ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 100, 0, 200);
- ScrollingMsg.SetText((unsigned char *)WelCome, sizeof(WelCome) - 1);
- }
- else
- FastLED.show();
- delay(10);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement