oui je suis sur le pin 3 mais sur mon autre bout de code je n'ai pas besoin de preciser D3 dans le code avec la lib FastLED_NeoMatrix.h
#include <Adafruit_GFX.h>
#include <FastLED_NeoMatrix.h>
#include <FastLED.h>
#define PIN 3
#define BRIGHTNESS 50
#define mw 40
#define mh 8
#define NUMMATRIX (mw*mh)
CRGB leds[NUMMATRIX];
// Define matrix width and height.
//FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh,
// NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
// NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE);
FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE);
// This could also be defined as matrix->color(255,0,0) but those defines
// are meant to work for adafruit_gfx backends that are lacking color()
#define LED_BLACK 0
uint32_t color_red=matrix->Color(255, 0, 0);
uint32_t color_white=matrix->Color(255, 255, 255);
uint32_t color_black=matrix->Color(0, 0, 0);
const byte YtLogoColors[3][3] = {{0, 0, 0}, {255, 0, 0}, {255, 255, 255}};
const byte YtLogo[8][10] =
{
{0, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 2, 2, 1, 1, 1, 1},
{1, 1, 1, 1, 2, 2, 2, 1, 1, 1},
{1, 1, 1, 1, 2, 2, 2, 1, 1, 1},
{1, 1, 1, 1, 2, 2, 1, 1, 1, 1},
{1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 0}
};
void scrolling_line(){
matrix->clear();
for (int i = 3;i<mw;i++){
for (int y = 2;y<mh;y++){
//matrix->drawLine(y,z,y,i,color_red);
// matrix->drawLine(2,1,2,5,color_red);
matrix->drawLine(8,7,0,0,color_red);
matrix->show();
delay(50);
}
}
}
void setup() {
// put your setup code here, to run once:
// Time for serial port to work?
delay(1000);
Serial.begin(115200);
Serial.print("Init on pin: ");
Serial.println(PIN);
Serial.print("Matrix Size: ");
Serial.print(mw);
Serial.print(" ");
Serial.print(mh);
Serial.print(" ");
//Serial.println(NUMMATRIX);
FastLED.addLeds<NEOPIXEL,PIN>( leds, NUMMATRIX ).setCorrection(TypicalLEDStrip);
//Serial.print("Setup serial: ");
//Serial.println(NUMMATRIX);
matrix->begin();
matrix->setTextWrap(false);
matrix->setBrightness(BRIGHTNESS);
matrix->print("Hello");
}
void loop() {
// put your main code here, to run repeatedly:
scrolling_line();
}