In my current project, I have several multi-dimensional arrays (usually stored in a .h file) that a user can select from. Upon being selected, the code increments through each point in the array. if there is a zero, its left blank. if there is anything else, it draws on that pixel.
I have gotten the code as it currently is to run properly on an atmega328p, so I know that it conceptually works. this is the error I am getting try to migrate to the ESP32 Dev Kit.
invalid conversion from 'uint16_t {aka short unsigned int}' to 'const byte ()[8] {aka const unsigned char ()[8]}' [-fpermissive]
I've been playing with this for a few hours, but I just cant figure it out. This is the necessary minimum parts of the code to recreate the error. any assistance with figuring this out would be appreciated
#include <FastLED.h>
#include <FastLED_NeoMatrix.h>
#include <Adafruit_GFX.h>
uint16_t taskList[]= {pic1, pic , pic3};
byte set=0;
byte counter=1;
int x = matrix->width();
FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(256, 32, 8,
NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG);
void loop() {
// put your main code here, to run repeatedly:
if (set>2) set=0;
bar(taskList[set]);
break;
}
void bar(const byte z[8][8])
{ matrix->fillScreen(0);
for (int i = 0; i < 256; i++) {
//clear screen
matrix->fillScreen(0);
for (int row = 0; row < 8; row++) {
for (int column = 0; column < 8; column++) {
if (pgm_read_byte(&(z[row][column])) == 1)
{
//draw new picture
matrix->drawPixel(column + x, row, matrix->Color(255, 0, 0));
}
}
}
//send picture to start of Matrix if picture has reached the end
if (--x < -8)x = 32;
matrix->show();
delay(30);
}
}
const byte pic1[8][8] PROGMEM= {
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0}
};
const byte pic2[8][8] PROGMEM= {
{1, 0, 0, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 0, 0, 0, 0, 1}
};
const byte pic3[8][8] PROGMEM= {
{1, 0, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 0, 1}
};