squix78 / MAX7219LedMatrix

Library for the ESP8266 on Arduino IDE displaying text on multiple 8x8 led matrices
MIT License
159 stars 71 forks source link

Problems in the code #1

Closed bfmike closed 9 years ago

bfmike commented 9 years ago

Hi,

You are using SPI_MODE3, but the device is actually SPI_MODE0 (probably worked originally because SPI_MODE3 isn't/wasn't supported.

You are also setting a C++ String object to NULL which isn't allowed. The easiest thing to do is set it to an empty string and then check the length.

Finally, the example "AnimateText" works fine, but the example in the README.md is a bit broken between the constructor and that .init() method. The following "git diff" shows the fixes for the library.

Many thanks for your work as I've found it very useful!

Mike

diff --git a/LedMatrix.cpp b/LedMatrix.cpp index ec1f18c..b092dae 100644 --- a/LedMatrix.cpp +++ b/LedMatrix.cpp @@ -17,7 +17,7 @@ void LedMatrix::init() { pinMode(mySlaveSelectPin, OUTPUT);

SPI.begin ();

marcelstoer commented 9 years ago

The diff you posted (thanks btw!) would be a lot more helpful for others if you put it into a block that isn't processed as Markdown (e.g. try ``` on the lines before and after).