HI there can anyone help with why my code isnt working
ive at the functions being call at the right time at stuff but it either wont dispaly at all or errors on complie
#ifndef LEDCONTROL_H
#define LEDCONTROL_H
#include <Arduino_LED_Matrix.h>
// Dimensions of the built-in LED matrix
#define MATRIX_WIDTH 12
#define MATRIX_HEIGHT 8
// Create an instance of the LED matrix
LEDMatrix matrix(MATRIX_WIDTH, MATRIX_HEIGHT);
// Initialize the LED matrix
inline void initLEDs() {
matrix.begin(); // Initialize the matrix
matrix.clear(); // Clear the display
matrix.show(); // Apply the changes
}
// Set an individual pixel
inline void setPixelViewing(int row, int col, uint32_t color) {
if (row < 0 || row >= MATRIX_HEIGHT || col < 0 || col >= MATRIX_WIDTH) return;
matrix.drawPixel(col, row, color); // Note: column and row order
matrix.show(); // Apply the changes
}
// Pump ON image
static uint32_t pumpOnImage[8][12] = {
{0x000000, 0x00FF00, 0x00FF00, 0x00FF00, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x00FF00, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x00FF00, 0x00FF00, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x00FF00, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x00FF00, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
};
// Pump OFF image
static uint32_t pumpOffImage[8][12] = {
{0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0xFF0000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0xFF0000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0xFF0000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0x000000, 0xFF0000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xFF0000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
{0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000},
};
// Display the Pump ON image
inline void displayPumpOnSymbol() {
matrix.clear();
for (int row = 0; row < 8; row++) {
for (int col = 0; col < 12; col++) {
matrix.drawPixel(col, row, pumpOnImage[row][col]);
}
}
matrix.show();
}
// Display the Pump OFF image
inline void displayPumpOffSymbol() {
matrix.clear();
for (int row = 0; row < 8; row++) {
for (int col = 0; col < 12; col++) {
matrix.drawPixel(col, row, pumpOffImage[row][col]);
}
}
matrix.show();
}
#endif // LEDCONTROL_H