markruys / arduino-max72xxpanel Goto Github PK
View Code? Open in Web Editor NEWArduino interface for Adafruit-GFX to control a set of 8x8 LEDs with a MAX7219 or MAX7221
License: Other
Arduino interface for Adafruit-GFX to control a set of 8x8 LEDs with a MAX7219 or MAX7221
License: Other
Hi- I went to try to substitute a 7219 in place of a I2C backpack used in the adafruit backpack
example sketch that implements a moving eyeball.
https://learn.adafruit.com/animating-multiple-led-backpacks/software
The sketch used a member function drawBitmap.
When substituting the 72xx lib for the backpack lib, and changing the matrix class structure from
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
to
Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
Compiling reports:
exit status 1
'class Max72xxPanel' has no member named 'drawBitmap'
indicating drawBitmap appears to not be supported, and in fact cannot be found
in the 72xx .cpp. I thought this paragraph on Adafruit:
"The Max72xxPanel library implements Adafruit's GFX library for multiple 8x8 LED displays driven by MAX7219 or MAX7221, in arbitrary rectangular layout. Support for basic graphic primitives and text. Features double buffering to prevent flicker. "
meant that any piece of code that uses the GFX library work under the Max72xxPanel lib.
Clearly I cannot substitute Max72xxPanel for Adafruit_8x8matrix I2C backpack lib.
Is this an oversight or do I have an unrealistic expectation of what it means for a "library to implement
Adafruit's GFX library"?
Would you care to update to support drawBitmap?
Putting a write() in front of the shutdown(false) inside constructor will avoid random pixel display on startup.
Love the Panel driver and I am using it over on my https://github.com/Qrome/marquee-scroller Scrolling Weather Clock.
My software supports the chaining of several of the Matrix displays. We found that there is a limit with the current configuration of up to 16 displays because of the int8_t on line 106 of the Max72xxPanel.cpp file. When we changed it to be an int16_t then we were able to use 20 or more chained together.
Maybe you could consider updating line 106 to int16_t so that it isn't limited to just 16 displays.
Thanks!
Is an ability to add a functions to get a pixel state?
And ability to inverse canvas or pixel?
Thanks.
How to increase the font height if for instance 4X(8*8) LED matrices are involved in displaying ticker using this library https://github.com/markruys/arduino-Max72xxPanel
where should I change?
I want to display korean but it seems this library not supporting it.
should I change in Adafruit_GFXlibrary ?
The same code is not working on Arduino Zero, Feather M0 but works on Arduino Uno or ESP8266
Any idea why?
Thx a lot
Works with Adafruit_GFX June 11.2013 and earlier. Below are the errors I receive when attempting to compile against the lastest Adafruit_GFX (July 05.2013)
Max72xxPanel.cpp: In constructor 'Max72xxPanel::Max72xxPanel(byte, byte, byte)':
Max72xxPanel.cpp:37: error: no matching function for call to 'Adafruit_GFX::Adafruit_GFX()'
Adafruit_GFX.h:17: note: candidates are: Adafruit_GFX::Adafruit_GFX(int16_t, int16_t)
Adafruit_GFX.h:13: note: Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)
I'm not sure if I'm just being stupid, but I can't get the Ticker example working.
My wiring is (on an Arduino Uno):
5V Arduino -> VCC on Panel 1 -> VCC on Panel 2
GND Arduino -> GND on Panel 1 -> GND on Panel 2
Pin 10 Arduino -> CS on Panel 1 -> CS on Panel 2
Pin 11 Arduino -> DIN on Panel 1 -> Din on Panel 2
Pin 13 Arduino -> CLK on Panel 1 -> CLK on Panel 2
My code is:
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
int pinCS = 10; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )
int numberOfHorizontalDisplays = 2;
int numberOfVerticalDisplays = 1;
Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
String tape = "it works!";
int wait = 35; // In milliseconds
int spacer = 1;
int width = 5 + spacer; // The font width is 5 pixels
void setup() {
matrix.setIntensity(1); // Use a value between 0 and 15 for brightness
// Adjust to your own needs
matrix.setPosition(0, 1, 0); // The first display is at <0, 0>
matrix.setPosition(1, 2, 0); // The second display is at <1, 0>
// matrix.setPosition(2, 2, 0); // The third display is at <2, 0>
// matrix.setPosition(3, 3, 0); // And the last display is at <3, 0>
// ...
// matrix.setRotation(0, 2); // The first display is position upside down
// matrix.setRotation(3, 2); // The same hold for the last display
}
void loop() {
for ( int i = 0 ; i < width * tape.length() + matrix.width() - 1 - spacer; i++ ) {
matrix.fillScreen(LOW);
int letter = i / width;
int x = (matrix.width() - 1) - i % width;
int y = (matrix.height() - 8) / 2; // center the text vertically
while ( x + width - spacer >= 0 && letter >= 0 ) {
if ( letter < tape.length() ) {
matrix.drawChar(x, y, tape[letter], HIGH, LOW, 1);
}
letter--;
x -= width;
}
matrix.write(); // Send bitmap to display
delay(wait);
}
}
The problem is that both panels show the same section of text. How should I change things so they work as shown in your video?
Thanks
some time after the data arrives on the radio module, the microcontroller freezes and reloads with the following libraries:
https://github.com/nRF24/RF24
https://github.com/nRF24/RF24Network
I have the following code. The setup works just fine but as soon as I add the write() into the loop, the program stops completely.
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
#include <Constants.h>
Max72xxPanel matrix = Max72xxPanel(MATRIX_PIN, 1, 1);
void setup() {
pinMode(BUTTON_ENTER, INPUT);
Serial.begin(2000000);
matrix.setIntensity(8);
matrix.setRotation(0, 3);
matrix.fillScreen(LOW);
matrix.drawChar(1, 0, 'S', HIGH, LOW, 1);
matrix.write();
}
void loop() {
Serial.println("loop");
matrix.fillScreen(LOW);
if(digitalRead(BUTTON_DOWN) == HIGH) {
matrix.drawChar(1, 0, 'D', HIGH, LOW, 1);
}
//matrix.write();
}
I'm not quite sure what causes this. In other programs it works just fine. Only in this one it causes a crash.
Hi !
Thanks this library, very usefull :)
I am looking for chaging the pin DIN and CLOCK but don't find it in your code.
Can you tell me how to change it ?
Thanks a lot
Thank you so much for this lovely library.
What if I want to use other font ?
I included font file from font folder, then
I have tried calling matrix.setfont(address of font), but it didn't displayed correctly(no characters at all),
when passed NULL value in setfont then it works perfectly.
Please Reply.
hello thanks for making this library, was implementing 16x2 display using this library
up to 31 panels in code are working ok ,
15 x 2 arrangement in code also working,
but if i set to 16x2 or 32 x1 displays show garbage
maybe some data type issue but couldn't figure it out
have eliminated any hardware problems
any guidance how to fix would be appreciated ! thanks
Hi, i would like to change the orientation(?) of my LED Matrix.
Im not sure if its the correct word, sorry.
My MAX72xx´s are setuped like this
1,2,3,4
5,6,7,8
9,10,11,12
13,14,15,16
Because that pictures are not displayed correct(I think).
Thanks in advance.
Sorry for my english Oo....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.