bartoszbielawski / LEDMatrixDriver

A replacement for Arduino's LedControl library
MIT License
75 stars 25 forks source link

Updates to examples to clarify width/height #19

Closed scottchiefbaker closed 5 years ago

scottchiefbaker commented 5 years ago

This is just an extension of the conversation from #17. I want to clean up the examples, maybe make a few more, and simplify the documentation on them. You mentioned:

In my own code I have just a single constant that is number of segments and I calculate everything based on that one.

This is what's in the examples now:

// Define LED Matrix dimensions: 32x8, 16x8, or 8x8
const int LEDMATRIX_WIDTH    = 32;
const int LEDMATRIX_HEIGHT   = 8;
const int LEDMATRIX_SEGMENTS = LEDMATRIX_WIDTH / LEDMATRIX_HEIGHT;

// The LEDMatrixDriver class instance
LEDMatrixDriver lmd(LEDMATRIX_SEGMENTS, LEDMATRIX_CS_PIN);

Are you suggesting it be changed to:

// Number of 8x8 segments you are connecting
const int LEDMATRIX_SEGMENTS = 4
const int LEDMATRIX_WIDTH    = LEDMATRIX_SEGMENTS * 8

// The LEDMatrixDriver class instance
LEDMatrixDriver lmd(LEDMATRIX_SEGMENTS, LEDMATRIX_CS_PIN);

Just want to clarify before I submit some PRs

bartoszbielawski commented 5 years ago

Yes, that's what I'm suggesting. The dimensions are fixed based on the number of segments, not the other way around.

bartoszbielawski commented 5 years ago

Merged, thanks :)