MD_MAX72xx.h setBuffer() issue

I have bought the cheap 8x8 LED matrix from Amazon. I have researched the HARDWARE issues with the library MD_MAX72xx.h and found one that somewhat works (and believe me I have tried them all) but NONE of them allow the sucessful use of the setBuffer() function. Has anybody had this problem and found a good solution? My present work around is the make a function called pushBuffer that is just basically calling setPoint() 64 times to send my buffer array.

[UPDATED]
I hope this is correct to guidelines.
So as the code shows I have chosen the top hardware definition but I have tried them all. All the happens is either top row or bottom row or left column or right column is lit on the display when I comment in other HW defintions (photo shows left column lit). The buffer is set to all '1's which should be all LED's on the display on after the call to mx.setBuffer(). I made the example code here a simple as possible to show problem.

Thanks,
Bob

// Including the required Arduino libraries
#include <MD_MAX72xx.h>
#include <SPI.h>

#define HARDWARE_TYPE MD_MAX72XX::DR0CR0RR0_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR0CR0RR1_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR0CR1RR0_HW //(GENERIC_HW)
// #define HARDWARE_TYPE MD_MAX72XX::DR0CR1RR1_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR0RR0_HW //(FC16_HW)
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR0RR1_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR1RR0_HW //(PAROLA_HW)
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR1RR1_HW //(ICSTATION_HW)

#define MAX_DEVICES 1
#define CLK_PIN   13  // or SCK
#define DATA_PIN  11  // or MOSI
#define CS_PIN    3   // or SS

uint8_t buffer[8] = {
  0b11111111,
  0b11111111,
  0b11111111,
  0b11111111,  
  0b11111111,
  0b11111111,
  0b11111111,
  0b11111111
};

// Create a new instance of the MD_MAX72XX class
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {
  // put your setup code here, to run once:
  pinMode(CLK_PIN , OUTPUT);
  pinMode(DATA_PIN , OUTPUT);
  pinMode(CS_PIN , OUTPUT);
  // Initialize the display
  mx.begin();
  // Set the intensity (brightness) of the display (0-15)
  mx.control(MD_MAX72XX::INTENSITY, 7);
  // Clear the display
  mx.clear(0);
  mx.setBuffer(0,8,buffer);
}

void loop() {
  // put your main code here, to run repeatedly:
}

Are you able to program it to display alpha/numerical text?

Please read the pinned post re 'How to get the most from the forum'.

Hi, I am not using (or want to) the paroloa library, I will not be scrolling and do not need a font library. I am using MD_MAX72xx.h. In order for the setPoint() to work properly, I had to use the DR0CR0RR0 hardware defintion for the specific display I bought from Amazon. The problem is in using the setBuffer() function, that does not work or not properly. The best I ever got was if I defined all bytes in buffer[] to
be 0b11111111 , after calling setBuffer(buffer), only the top row of display would be lit.

[quote="sonofcy, post:3, topic:1389934"]
'How to get the most from the forum'
I would first have to be able to find it

It is a pinned post on every forum. Here is what you will see when you figure out how to navigate the forum.


Basically there are rules re code, errors, wiring that if are followed will give you the best result, If not then it will take much longer.
I strongly suggest you start at square one, having to mangle the setBuffer function is a big clue that something basic is wrong, maybe a wrong library?

I apparently am not at your level. I do not even know what a pinned post is. Thanks for trying though!

Here are som screen shots that should help. If not, here is a link https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/681314



Thanks @ sonofcy It will take me a while to read that much guidelines. I have add

Is this how you prepare setBuffer()¿

bool MD_MAX72XX::setBuffer(uint16_t col, uint8_t size, uint8_t *pd)

In... MD_MAX72XX/src/MD_MAX72xx_pix.cpp at main · MajicDesigns/MD_MAX72XX · GitHub

im sorry I am too mortified to post as I believe everything I do will not be in guidelines but I did uou exeample code from where you say MajicDesigns/MD_MAX72XX · GitHub

That's okay. Consider it a welcoming.

I was asking if your use of setBuffer() followed the definition.

I edited my post to put code and picture Should I have started all over with new topic?

Next time just add a new entry to this thread, but your comment will alert existing readers to the change.

Think about what a helper needs to see. Do you think I care about seeing the UNO or a CLEAR picture of what wire goes in what pin? We need to see all the wires, especially when there are two whites and two purples. We actually prefer you to hand-draw where the wires go, then take a picture of the drawing. Right now, the picture is not useful.

Which sample file is it you are using?
Where are the changes you made for buffer?

Your original setBuffer() was sending the zeroth element in the array, only. I found this by playing with the bits in your buffer (see below), which lead me to the setBuffer() call, then to the first argument in setBuffer() call which (when walking 0 through 7) I found to have an effect.

// Including the required Arduino libraries
#include <MD_MAX72xx.h>
#include <SPI.h>

#define HARDWARE_TYPE MD_MAX72XX::DR0CR0RR0_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR0CR0RR1_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR0CR1RR0_HW //(GENERIC_HW)
// #define HARDWARE_TYPE MD_MAX72XX::DR0CR1RR1_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR0RR0_HW //(FC16_HW)
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR0RR1_HW
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR1RR0_HW //(PAROLA_HW)
// #define HARDWARE_TYPE MD_MAX72XX::DR1CR1RR1_HW //(ICSTATION_HW)

#define MAX_DEVICES 1
#define CLK_PIN   13  // or SCK
#define DATA_PIN  11  // or MOSI
#define CS_PIN    3   // or SS

uint8_t buffer[8] = { // EDITED SOME BITS
  0b01111111,
  0b10111111,
  0b11011111,
  0b11101111,
  0b11110111,
  0b11111011,
  0b11111101,
  0b11111110
};

// Create a new instance of the MD_MAX72XX class
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {
  // put your setup code here, to run once:
  pinMode(CLK_PIN, OUTPUT);
  pinMode(DATA_PIN, OUTPUT);
  pinMode(CS_PIN, OUTPUT);
  // Initialize the display
  mx.begin();
  // Set the intensity (brightness) of the display (0-15)
  mx.control(MD_MAX72XX::INTENSITY, 7);
  // Clear the display
}

void loop() {
  for (int i = 0; i < 8; i++) {
    mx.setBuffer(i, 8, buffer); // change this
    delay(250);
  }
  mx.clear();
}

I am not using a sample file, This is my code.

Thanks for sucking the fun out of the hobby.

Thank you! Your post indirectly gave me the answer. Let me share. First off though, I would never call setBuffer() 8 times, once per column as that is not it's intention. It is made to transfer an entire 8 bytes (64 bits) to the display at one time as described here :https://majicdesigns.github.io/MD_MAX72XX/class_m_d___m_a_x72_x_x.html#a1aaabf8c4df556c3e9a04a1319234261
Calling it 8 times would defeat its purpose and use valuable processing clock cycles and there is another function setColumn() that is made for that specific thing. Now, the definition of the parameters for the setBuffer() call from above link is quite misleading to me "col address of the start display column [0..[getColumnCount()]" and I could see where it suggested calling it the number of columns times. I just assumed 0 as that is logically the column from where I wish start. But your code inspired my to play with this parameter and discovered the answer. The following code line works: setBuffer(7,8,buffer). This copies the entire buffer to the screen display in one shot which I have tested with various buffer patterns sucessfully.
I have no idea why but the end result is what I have been trying for. Thanks again for the catalyst! :grinning_face: