As a beginner I succeeded setting up the hardware using SmartLed 4 with Teensy 3.4 and Adafruit 32x64 LED matrix. All the example sketches run perfect. For some testing I now have modified the FastLED_Functions sketch (see code) so only the background animation is shown. So far this works but I did not succeed increasing the overall brightness of the background. Some help would be appreciated.
#include <SmartLEDShieldV4.h>
#include <SmartMatrix3.h>
#include <FastLED.h>
#define COLOR_DEPTH 24
const uint8_t kMatrixWidth = 64;
const uint8_t kMatrixHeight = 32;
const uint8_t kRefreshDepth = 36;
const uint8_t kDmaBufferRows = 4; rate
const uint8_t kPanelType = SMARTMATRIX_HUB75_32ROW_MOD16SCAN;
const uint8_t kMatrixOptions = (SMARTMATRIX_OPTIONS_NONE);
const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
const uint8_t kScrollingLayerOptions = (SM_SCROLLING_OPTIONS_NONE);
SMARTMATRIX_ALLOCATE_BUFFERS(matrix, kMatrixWidth, kMatrixHeight, kRefreshDepth, kDmaBufferRows, kPanelType, kMatrixOptions);
SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kBackgroundLayerOptions);
SMARTMATRIX_ALLOCATE_SCROLLING_LAYER(scrollingLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kScrollingLayerOptions);
static uint16_t x;
static uint16_t y;
static uint16_t z;
uint16_t speed = 10;
uint16_t scale = 20;
uint8_t noise[kMatrixWidth][kMatrixHeight];
void setup() {
Serial.begin(38400);
Serial.println("Start (setup)");
delay(1000);
matrix.addLayer(&backgroundLayer);
matrix.addLayer(&scrollingLayer);
matrix.begin();
backgroundLayer.setBrightness(255);
x = random16();
y = random16();
z = random16();
}
void fillnoise8() {
for(int i = 0; i < kMatrixWidth; i++) {
int ioffset = scale * i;
for(int j = 0; j < kMatrixHeight; j++) {
int joffset = scale * j;
noise[i][j] = inoise8(x + ioffset,y + joffset,z);
}
}
z += speed;
}
void loop() {
static uint8_t circlex = 0;
static uint8_t circley = 0;
while(backgroundLayer.isSwapPending());
rgb24 *buffer = backgroundLayer.backBuffer();
static uint8_t ihue=0;
fillnoise8();
for(int i = 0; i < kMatrixWidth; i++) {
for(int j = 0; j < kMatrixHeight; j++) {
buffer[kMatrixWidth*j + i] = CRGB(CHSV(255,noise[j][i],noise[i][j]));
}
}
ihue+=1;
backgroundLayer.swapBuffers(false);
}