/*
// - Lien vidéo : https://youtu.be/m0A50SI9s7c
// REQUIRES the following Arduino libraries:
// - FastLED Library: https://github.com/pixelmatix/FastLED
// - Getting Started ESP32 / ESP32S : https://www.youtube.com
*/
#include <FastLED.h>
#include "GPFont.h"
// Params for width and height
const uint8_t kMatrixWidth = 50;
const uint8_t kMatrixHeight = 8;
#define NUM_LEDS (kMatrixWidth * kMatrixHeight)
#define PIN_LEDS 4
#define COLOR_ORDER GRB // It's GRB for WS2812B and BGR for APA102
#define LED_TYPE WS2812B // What kind of strip are you using (WS2801, WS2812B or APA102)?
#define CLK_PIN 12
// Initialize changeable global variables.
uint8_t brightness = 250; // Overall brightness definition. It can be changed on the fly.
//struct CRGB leds[NUM_LEDS]; // Initialize our LED array.
const bool kMatrixSerpentineLayout = true;
String Message = "Great Projects wish you a very nice day.";
int xmsg = 160;
#include "Effects.h"
Effects effects;
//
void setup() {
Serial.begin(115200);
Serial.println("resetting!");
delay(3000);
//FastLED.addLeds<LED_TYPE,PIN_LEDS,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
// LEDS.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS); // Use this for WS2812B
LEDS.addLeds<LED_TYPE, PIN_LEDS, COLOR_ORDER>(leds, NUM_LEDS); // Use this for WS2801 or APA102
//FastLED.addLeds<LED_TYPE,PIN_LEDS,RGB>(leds,NUM_LEDS);
FastLED.setBrightness(brightness);
effects.setFont(GPFont8x8);
}
void drawMesg(String textmsg) {
memset(leds, 0x0, NUM_LEDS*3);
int text_length = -(textmsg.length() * 8);
effects.setCursor(xmsg, 0);
effects.print(textmsg);
xmsg -= 1;
if (xmsg < text_length) {
xmsg = 160;
}
}
void loop() {
effects.FillNoise();
drawMesg(Message);
FastLED.show();
EVERY_N_SECONDS(10){
effects.NoiseVariablesSetup();
}
noise_x += 800;
noise_y += 800;
noise_z += 800;
delay(10);
}