majicdesigns / md_max72xx Goto Github PK
View Code? Open in Web Editor NEWLED Matrix Library
License: GNU Lesser General Public License v2.1
LED Matrix Library
License: GNU Lesser General Public License v2.1
Is it possible to get this library added to the PlatformIO Registry like some of your others?
After updating I see the default font has changed. How do I revert to the old font with the updated version ? Thanks.
Sketch/library MD_MAX72xx_Test.ino works perfectly (with ESP-specific SPI pins) on 8 x FC-16 devices. When used on my 1 metre long MAX7219 strip (28 devices) it fails to control the last 6-8 modules (gets progressively worse, the longer the sketch runs for). Powered via a separate 3v3 supply in case this was causing an issue (and the ESP32's onboard 3v3 regulator cannot support this current requirement anyway).
Using MD_MAX72XX library version 3.3.0 (taken from library.json).
Running an unchanged example sketch MD_MAX72xx_Test.ino in a Visual Studio Code (PlatformIO) environment with the Arduino framework on an ESP32 Dev Module. Windows 11 Home. FC-16 devices.
11th September 2022.
I have tested the 28 device strip using an Arduino UNO and a very simple sketch (not using this library) and it correctly displays/scrolls the entire 28-device length so I believe the hardware is wired up & working correctly.
What is happening: The first 20 approx device (counting from the right) are correctly controlled with text, graphics etc. The remaining device remain either full lit (all LEDs on or off, varies). The graphics seems to run into the devices that are permanently lit.
Video demo (speeded up) here: https://www.dropbox.com/s/eidwwuvr9cvlp7k/MAX7219.mp4?dl=0
Best Regards
Ralph S Bacon
Hi Marco,
If I use matrix.control(MD_MAX72XX::INTENSITY, 0); to set the intensity to the lowest value, it is still too bright when used for a clock in a bedroom.
How can I 'hack' this to lower the brighness? Since the required intensity value is an uint I can't use negative values or floats, but may be there is an easy way to hack it, before I'm diving in your source code ;-)
I'm using this display: DAOKI MAX7219 Dot led Matrix MCU 8x32 Control LED Display Module Drive for Arduino Raspberry Pi 4 in 1 (Brand: DAOKI)
Thanks a lot!
Gert
hello, im using latest library MD MAX72xx version 3.3.0, i have using example sketch MD_MAX72XX_Message_ESP8266 on Wemos D1 mini
when i restart microcontroller, all messages that i send from web browser were back displaying IP address, is there a way to store message in internal memory wemos mini d1 esp8266?
Before submitting this issue
[x ] Have you tried using the latest version of the library?
[ x] Have you checked this has not already been submitted and/or resolved?
[ x] If you are requesting help a better choice may be the Arduino forum
Some hardware has more than one SPI port and it would be useful to be able to use these as the SPI interface.
eg, Teensy 4.1
Additional class constructor that takes a reference to the SPI as a parameter. Current SPI would operate by default.
thank you for your nice Library and the "daft punk helmet" demo!!!
I did run it on the ESP8266 and it works.
then I tried to add the Wifi & MQTT features that I use in other projects:
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <PubSubClient.h>
and it crashes :-(
did someone had more success with that ?
to be more precise:
I got WiFi connected
MQTT ...connected
and it crashes at:
resetMatrix();
How is it possible to change the font?
The default seems to be very straight number, I want the numbers more rounded.
How can I configure the LCD5x7_fixed_single font to be used?
Thanks
line 111 in MD_MAX72xx_font.cpp sends lines of data to the serial port in version 3.0.1
Serial.print(max);
how to change invertion of letters in led matrix by using md_max72xx.h file
Hi, there is an error in the MD_MAX72xx_Eyes.ino
example, in the following line, "eye =" instead of "M ="
//MD_MAX72XX eye = MD_MAX72XX(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
regards.
What is the name of the default font in this library? Where can I find the ttf file for that?
I have a 4 devices 8x8 MAX7219 display block linke below:
https://de.aliexpress.com/item/32955063973.html?spm=a2g0s.9042311.0.0.27424c4dEH9hyR
I'm using an ESP8266, NodeMCU (LOLIN) and the newest 3.1 library of MD_MAX72XX and MD_Parola).
I'm using the Text-Scroll example and it works but the scrolling text is horizontally mirrored.
So each char is flipped 180degree horizontally. so e,r are shown to the left side instead of right side.
Any ideas?
I have tried the different HW models, but it get worse, if I use nay other model:
// PAROLA_HW, ///< Use the Parola style hardware modules.
// GENERIC_HW, ///< Use 'generic' style hardware modules commonly available.
// ICSTATION_HW, ///< Use ICStation style hardware module.
// FC16_HW ///< Use FC-16 style hardware module.
With MAX7219, initialization can cause a quick flash in the display. The reason is this line here:
https://github.com/MajicDesigns/MD_MAX72XX/blob/main/src/MD_MAX72xx.cpp#L119
This causes the MAX7219 to latch in random data. Removing the line fixes the issue.
esp32 dev mod
i get when compiling this warning
libraries\MD_MAX72XX\src/MD_MAX72xx.h:14:2: warning: #warning "ARDUINO SPI interface activated." [-Wcpp]
#warning "ARDUINO SPI interface activated."
I notice also spi is runnning slow. Speed scrolling stays the same. even if i change speed to 25.
My includes are the following.
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <elapsedMillis.h>
#include <RTClib.h>
#include <WiFiManager.h>
good evening
sorry for this but am very new to this hobby,
but keep holding this error what am I doing wrong.
again sorry .
greeting Dinand
MD_MAX72xx.h:258:1: error: expected unqualified-id before 'class'
class MD_MAX72XX
^
MD_MAX72xx.h:258:1: error: expected constructor, destructor, or type conversion before 'class'
exit status 1
expected unqualified-id before 'class'
Before submitting this issue
[yes ] Have you tried using the latest version of the library?
[ yes] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum
The text in print statement in line 349 of "Font Builder/src/txt2font.c" is missing the trailing semicolon in the output font array definition. Needs semicolon after closing curly bracket.
Org line:
fprintf(G.fpOut, "}\n\n");
Should be:
fprintf(G.fpOut, "};\n\n");
**Library Version: 3.0.2
**Arduino IDE version: 1.8.8
**Hardware model/type: WeMos D1 R1
**OS and Version: Ubuntu 18.04
Build any font.h using the supplied example font.txt files. Include resultant font header file in user src. Compiling user src will issue what appears to be unrelated errors -- traceable back to the missing semicolon.
Array definition need to be terminated by a semicolon.
I could not find a lot of documentation is around wiring an ESP32 with MD_MAX72XX so I thought i will leave this here for anyone trying to figure it out. (This took me a LONG time understand hehe)
I have tested this on my NodeMCU32s (with 38 pins)
To use the hardware SPI - Wire your ESP32 to the following pins
(src: https://www.teachmemicro.com/esp32-max7219-wifi-message-board/)
Hope it helps :)
Before submitting this issue
[X] Have you tried using the latest version of the library?
[X] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum
Describe your issue here.
Library Version: 3.3.0
Arduino IDE version: 1.8.5
Host OS and Version: win7
CPU Hardware model/type: i7-3820
Matrix hardware model/type: [ ] Parola [ ] Generic [ ] ICStation [ ] FC-16 [ ] Custom (describe how wired)
Enter in browser any symbol beyond 159 (9F) and it is not displayed correctly. It shows the code e.g. %A0 but not the actual symbol.
Show all symbols from code 00 to code FF.
Only symbols from 00 to 9F are displayed. Others, from A0 to FF are not shown (%A0 to %FF on MAX7219).
Insert your compilable code here (no code snippets).
Before submitting this issue
[X] Have you tried using the latest version of the library?
[X] Have you checked this has not already been submitted and/or resolved?
[maybe] If you are requesting help a better choice may be the Arduino forum
Robot Eye example is not compatible with ESP32, when i try to compile the code for ESP32 both in the Arduino IDE and in PlatformIO i get a lot of errors. If i try with arduino board the code compile normaly
3.1.0:
Arduino IDE version: 1.8.21 - PlatformIO Home 2.1.0 · Core 3.6.7
Hardware model/type: ESP32
OS and Version:
Load example, select Arduino Board, it compiles ok, select esp32 board, see the errors
i think de c++ code should be full functional to all microcontrollers , the other examples works fine
Hi,
Thank you very much for this excellent library.
My client wants to customize the font without recompiling the project.
I searched for a way to load the font data from a binary file on an SD card.
I looked at MD_MAX72xx_font.cpp
and saw that the library assumes that the font is in program memory.
Unfortunately, this design prevents customizing the font at runtime.
Could you provide a way to support this scenario?
I wish we could directly pass the File
instance to setFont()
, but passing a pointer would be a good first step.
Best regards,
Benoit
I'm wondering if there is a way to flip the display vertically in software. I accidentally installed my display upside down ;(
I don't pretend to know how Github works
The link to MD_MAX72xx.h on https://majicdesigns.github.io/MD_MAX72XX/page_software.html is broken
All the links on https://majicdesigns.github.io/MD_MAX72XX/files.html are broken
All the links on https://majicdesigns.github.io/MD_MAX72XX/globals.html are broken
.
Before submitting this issue
[] Have you tried using the latest version of the library?
[] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum
The Excel Font Generator Tool "copy to clipboard" doesn't work on windows 10. But I found a solution.
Library Version:
Arduino IDE version:
Host OS and Version:
CPU Hardware model/type:
Matrix hardware model/type: [ ] Parola [ ] Generic [ ] ICStation [*] FC-16 [ ] Custom (describe how wired)
It is not with Arduino code, it is about the Excel Font Generator Tool.
It should copy the generated array into clipboard.
It does not copy as obj.PutInClipboard does not work on windows 10.
MyDataObj.PutInClipboard
Before submitting this issue
[X ] Have you tried using the latest version of the library?
[X ] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum
AP of the ESP is still active after connection to wireless network.
Library Version:
Arduino IDE version:
Host OS and Version:
CPU Hardware model/type:
Matrix hardware model/type: [ ] Parola [ ] Generic [ ] ICStation [ ] FC-16 [ ] Custom (describe how wired)
Simply flash the example code.
Connection to wireless network should deactivate AP mode of ESP.
Connection to wireless network is done. AP mode of ESP is active also.
Insert your compilable code here (no code snippets).
Currently when switching between fonts triggers a number such as 5 or 7 to be written to the serial port. Could this be disabled as it is causing unwanted traffic? I took a brief look at the source but couldn't find the culprit.
I have a setup with 4 devices.
When applying TFLR transformation, both external devices are swapped (good),
but both internal devices are not swapped.
For example if I display "MAX!", after transformation I get "!AXM" instead of "!XAM"
in file MD_MAX72xx_pix.cpp
, in method MD_MAX72XX::transform()
case TFLR: // Transform Flip Left to Right (use the whole field)
// first reverse the device buffers end for end
for (uint8_t buf = 0; buf < (endDev - startDev )/2; buf++)
The number of devices should be (endDev - startDev + 1)
a nd not (endDev - startDev)
ex: startDev=0 and endDev = 3, there are 4 devices. and (endDev - startDev +1) /2 = 2 swaps should be performed.
Formula is still valid for odd number of devices.
#include <MD_MAX72xx.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN 13 // or SCK
#define DATA_PIN 11 // or MOSI
#define CS_PIN 10 // or SS
// SPI hardware interface
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup()
{
mx.begin();
mx.clear();
}
void loop()
{
mx.setChar(6, '!');
mx.setChar(14, 'X');
mx.setChar(22, 'A');
mx.setChar(30, 'M');
delay(2000);
mx.transform(MD_MAX72XX::TFLR);
delay(5000);
mx.transform(MD_MAX72XX::TINV);
delay(700);
delay(10000);
}
I wish to remove the blank column between characters, instead adding the column to the font table to allow me to create sprite font characters that can be added end to end to create an image.
I have updated the font table to increase the width of the "normal" characters by one, and adding "0," to the end of the line for the blank column, but when I set the CHAR_SPACING constant to 0 it only draws the first character and nothing more on the LED.
Is there any way to get around this to not have the column hard-written?
Library Version: MD_MAX72XX 3.2.4
Arduino IDE version: 1.8.13
Hardware model/type: NodeMCU 0.9 with ESP8266
OS and Version: Windows 10
Using the code from mytechtutor as linked below (HTML edited).
Editing line 48 "const uint8_t CHAR_SPACING = 1;" to "const uint8_t CHAR_SPACING = 0;"
Column width between characters = 0 (so none).
script displays only the first character of the string ("C" in the code below)
#include <ESP8266WiFi.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define PRINT_CALLBACK 0
#define DEBUG 1
#define LED_HEARTBEAT 1
#if DEBUG
#define PRINT(s, v) { Serial.print(F(s)); Serial.print(v); }
#define PRINTS(s) { Serial.print(F(s)); }
#else
#define PRINT(s, v)
#define PRINTS(s)
#endif
#if LED_HEARTBEAT
#define HB_LED D0
#define HB_LED_TIME 500 // in milliseconds
#endif
// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define MAX_DEVICES 4
#define CLK_PIN D5 // or SCK
#define DATA_PIN D7 // or MOSI
#define CS_PIN D8 // or SS
// SPI hardware interface
//MD_MAX72XX mx = MD_MAX72XX(CS_PIN, MAX_DEVICES);
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW //edit this as per your LED matrix hardware type
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary pins
//MD_MAX72XX mx = MD_MAX72XX(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
// WiFi login parameters - network name and password
const char* ssid = "SSID_REMOVED"; // edit your wifi SSID here
const char* password = "SSID_PASS_REMOVED"; // edit your wifi password here
// WiFi Server object and parameters
WiFiServer server(80);
// Global message buffers shared by Wifi and Scrolling functions
const uint8_t MESG_SIZE = 255;
const uint8_t CHAR_SPACING = 1;
const uint8_t SCROLL_DELAY = 75;
char curMessage[MESG_SIZE];
char newMessage[MESG_SIZE];
bool newMessageAvailable = false;
char WebResponse[] = "HTTP/1.1 200 OK\nContent-Type: text/html\n\n";
char WebPage[] =
"<!DOCTYPE html>\n" \
"<html>\n" \
"<head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n" \
"<title>ESP8266 AND MAX7219 LED Matrix Controller</title>\n" \
"<style>\n" \
"html, body \n" \
"{\n" \
"font-family: Helvetica; \n" \
"display: block;\n" \
"margin: 0px auto;\n" \
"text-align: center;\n" \
"background-color: #cad9c5;\n" \
"}\n" \
"#container \n" \
"{\n" \
"width: 100%;\n" \
"height: 100%;\n" \
"margin-left: 5px;\n" \
"margin-top: 20px;\n" \
"border: solid 2px;\n" \
"padding: 10px;\n" \
"background-color: #2dfa53;\n" \
"}\n" \
"</style>"\
"<script>\n" \
"strLine = \"\";\n" \
"function SendText()\n" \
"{\n" \
" nocache = \"/&nocache=\" + Math.random() * 1000000;\n" \
" var request = new XMLHttpRequest();\n" \
" strLine = \"&MSG=\" + document.getElementById(\"txt_form\").Message.value;\n" \
" request.open(\"GET\", strLine + nocache, false);\n" \
" request.send(null);\n" \
"}\n" \
"</script>\n" \
"</head>\n" \
"<body>\n" \
"<H1><b>ESP8266 and MAX7219 LED Matrix WiFi Control</b></H1>\n" \
"<div id=\"container\">\n" \
"<form id=\"txt_form\" name=\"frmText\">\n" \
"<label>Message:<input type=\"text\" name=\"Message\" maxlength=\"255\" id=\"Message\"></label>\n" \
"</form>\n" \
"<input type=\"submit\" value=\"Send Text\" onclick=\"SendText()\">\n" \
"<p>\n" \
"<b>For custom characters enter the following strings:</b><br>\n" \
"Try: %96 XMAS : %97 BR : %9A WiFi : %9B YT : %9C FB : %9D Twitter : %9E Insta : %9F Camera</br></br>\n" \
"</p>\n" \
"<h3>Custom defined characters</h3>\n" \
"<table align=center>\n" \
"<tr><th>Code to type</th><th>Symbol to appear</th><tr>\n" \
"<tr><td><b>%96</b></td><td>Xmas Tree</td></tr>\n" \
"<tr><td><b>%9A</b></td><td>WiFi</td></tr>\n" \
"<tr><td><b>%9B</b></td><td>YouTube</td></tr>\n" \
"<tr><td><b>%9C</b></td><td>Facebook</td></tr>\n" \
"<tr><td><b>%9D</b></td><td>Twitter</td></tr>\n" \
"<tr><td><b>%9E</b></td><td>Instagram</td></tr>\n" \
"<tr><td><b>%9F</b></td><td>Camera</td></tr>\n" \
"</table>\n" \
"</div>\n" \
"<script>\n"
" var url_string = window.location.href; //window.location.href\n"
" var url = new URL(url_string);\n"
" var c = url.searchParams.get(\"Message\");\n"
" document.getElementById(\"Message\").value = c;\n"
"</script>\n" \
"</body>\n" \
"</html>";
char *err2Str(wl_status_t code)
{
switch (code)
{
case WL_IDLE_STATUS: return("IDLE"); break; // WiFi is in process of changing between statuses
case WL_NO_SSID_AVAIL: return("NO_SSID_AVAIL"); break; // case configured SSID cannot be reached
case WL_CONNECTED: return("CONNECTED"); break; // successful connection is established
case WL_CONNECT_FAILED: return("CONNECT_FAILED"); break; // password is incorrect
case WL_DISCONNECTED: return("CONNECT_FAILED"); break; // module is not configured in station mode
default: return("??");
}
}
uint8_t htoi(char c)
{
c = toupper(c);
if ((c >= '0') && (c <= '9')) return(c - '0');
if ((c >= 'A') && (c <= 'F')) return(c - 'A' + 0xa);
return(0);
}
boolean getText(char *szMesg, char *psz, uint8_t len)
{
boolean isValid = false; // text received flag
char *pStart, *pEnd; // pointer to start and end of text
// get pointer to the beginning of the text
pStart = strstr(szMesg, "/&MSG=");
if (pStart != NULL)
{
pStart += 6; // skip to start of data
pEnd = strstr(pStart, "/&");
if (pEnd != NULL)
{
while (pStart != pEnd)
{
if ((*pStart == '%') && isdigit(*(pStart+1)))
{
// replace %xx hex code with the ASCII character
char c = 0;
pStart++;
c += (htoi(*pStart++) << 4);
c += htoi(*pStart++);
*psz++ = c;
}
else
*psz++ = *pStart++;
}
*psz = '\0'; // terminate the string
isValid = true;
}
}
return(isValid);
}
void handleWiFi(void)
{
static enum { S_IDLE, S_WAIT_CONN, S_READ, S_EXTRACT, S_RESPONSE, S_DISCONN } state = S_IDLE;
static char szBuf[1024];
static uint16_t idxBuf = 0;
static WiFiClient client;
static uint32_t timeStart;
switch (state)
{
case S_IDLE: // initialise
PRINTS("\nS_IDLE");
idxBuf = 0;
state = S_WAIT_CONN;
break;
case S_WAIT_CONN: // waiting for connection
{
client = server.available();
if (!client) break;
if (!client.connected()) break;
#if DEBUG
char szTxt[20];
sprintf(szTxt, "%03d:%03d:%03d:%03d", client.remoteIP()[0], client.remoteIP()[1], client.remoteIP()[2], client.remoteIP()[3]);
PRINT("\nNew client @ ", szTxt);
#endif
timeStart = millis();
state = S_READ;
}
break;
case S_READ: // get the first line of data
PRINTS("\nS_READ");
while (client.available())
{
char c = client.read();
if ((c == '\r') || (c == '\n'))
{
szBuf[idxBuf] = '\0';
client.flush();
PRINT("\nRecv: ", szBuf);
state = S_EXTRACT;
}
else
szBuf[idxBuf++] = (char)c;
}
if (millis() - timeStart > 1000)
{
PRINTS("\nWait timeout");
state = S_DISCONN;
}
break;
case S_EXTRACT: // extract data
PRINTS("\nS_EXTRACT");
// Extract the string from the message if there is one
newMessageAvailable = getText(szBuf, newMessage, MESG_SIZE);
PRINT("\nNew Msg: ", newMessage);
state = S_RESPONSE;
break;
case S_RESPONSE: // send the response to the client
PRINTS("\nS_RESPONSE");
// Return the response to the client (web page)
client.print(WebResponse);
client.print(WebPage);
state = S_DISCONN;
break;
case S_DISCONN: // disconnect client
PRINTS("\nS_DISCONN");
client.flush();
client.stop();
state = S_IDLE;
break;
default: state = S_IDLE;
}
}
void scrollDataSink(uint8_t dev, MD_MAX72XX::transformType_t t, uint8_t col)
// Callback function for data that is being scrolled off the display
{
#if PRINT_CALLBACK
Serial.print("\n cb ");
Serial.print(dev);
Serial.print(' ');
Serial.print(t);
Serial.print(' ');
Serial.println(col);
#endif
}
uint8_t scrollDataSource(uint8_t dev, MD_MAX72XX::transformType_t t)
// Callback function for data that is required for scrolling into the display
{
static enum { S_IDLE, S_NEXT_CHAR, S_SHOW_CHAR, S_SHOW_SPACE } state = S_IDLE;
static char *p;
static uint16_t curLen, showLen;
static uint8_t cBuf[8];
uint8_t colData = 0;
// finite state machine to control what we do on the callback
switch (state)
{
case S_IDLE: // reset the message pointer and check for new message to load
PRINTS("\nS_IDLE");
p = curMessage; // reset the pointer to start of message
if (newMessageAvailable) // there is a new message waiting
{
strcpy(curMessage, newMessage); // copy it in
newMessageAvailable = false;
}
state = S_NEXT_CHAR;
break;
case S_NEXT_CHAR: // Load the next character from the font table
PRINTS("\nS_NEXT_CHAR");
if (*p == '\0')
state = S_IDLE;
else
{
showLen = mx.getChar(*p++, sizeof(cBuf) / sizeof(cBuf[0]), cBuf);
curLen = 0;
state = S_SHOW_CHAR;
}
break;
case S_SHOW_CHAR: // display the next part of the character
PRINTS("\nS_SHOW_CHAR");
colData = cBuf[curLen++];
if (curLen < showLen)
break;
// set up the inter character spacing
showLen = (*p != '\0' ? CHAR_SPACING : (MAX_DEVICES*COL_SIZE)/2);
curLen = 0;
state = S_SHOW_SPACE;
// fall through
case S_SHOW_SPACE: // display inter-character spacing (blank column)
PRINT("\nS_ICSPACE: ", curLen);
PRINT("/", showLen);
curLen++;
if (curLen == showLen)
state = S_NEXT_CHAR;
break;
default:
state = S_IDLE;
}
return(colData);
}
void scrollText(void)
{
static uint32_t prevTime = 0;
// Is it time to scroll the text?
if (millis() - prevTime >= SCROLL_DELAY)
{
mx.transform(MD_MAX72XX::TSL); // scroll along - the callback will load all the data
prevTime = millis(); // starting point for next time
}
}
void setup()
{
#if DEBUG
Serial.begin(115200);
PRINTS("\n[MD_MAX72XX WiFi Message Display]\nType a message for the scrolling display from your internet browser");
#endif
#if LED_HEARTBEAT
pinMode(HB_LED, OUTPUT);
digitalWrite(HB_LED, LOW);
#endif
// Display initialisation
mx.begin();
mx.setShiftDataInCallback(scrollDataSource);
mx.setShiftDataOutCallback(scrollDataSink);
curMessage[0] = newMessage[0] = '\0';
// Connect to and initialise WiFi network
PRINT("\nConnecting to ", ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
PRINT("\n", err2Str(WiFi.status()));
delay(500);
}
PRINTS("\nWiFi connected");
// Start the server
server.begin();
PRINTS("\nServer started");
// Set up first message as the IP address
sprintf(curMessage, "Connected to \x9A %s @ IP:%03d:%03d:%03d:%03d", ssid, WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], WiFi.localIP()[3]);
PRINT("\nAssigned IP ", curMessage);
}
void loop()
{
#if LED_HEARTBEAT
static uint32_t timeLast = 0;
if (millis() - timeLast >= HB_LED_TIME)
{
digitalWrite(HB_LED, digitalRead(HB_LED) == LOW ? HIGH : LOW);
timeLast = millis();
}
#endif
handleWiFi();
scrollText();
}
This is a question rather then a bug report. Feel free to delete/close if you feel like this is not the place.
I have a led matrix with 4 columns (DIG0-DIG1) and 8 rows. I'm trying to disable the unused 4 columns however I'm not sure what I should set SCANLIMIT to as the maximum number it can have looks like is 7 thus making me feel that the number does not correlate directly with the number of digits/columns that one wants to have enabled.
Any pointer would be appreciated. Thanks.
Before submitting this issue
[x] Have you tried using the latest version of the library?
[x] Have you checked this has not already been submitted and/or resolved?
[x] If you are requesting help a better choice may be the Arduino forum
I found a handful of surplus 8x8 LED modules in my stuff, and designed a MAX7219 board to drive them. I didn't pay much attention to the row/col ordering because in other LED projects I've used it's simple enough to change that mapping.
I can't seem to figure out how to change that mapping for MD_MAX72XX. I have this matrix that I want to drive with Parola:
| Dig-3 | Dig-6 | Dig-2 | Dig-1 | Dig-7 | Dig-5 | Dig-4 | Dig-0
SEG-B |
SEG-F |
SEG-G |
SEG-D |
SEG-E |
SEG-C |
SEG-A |
SEG-DP |
How can I define that matrix in MD_MAX72XX?
Library Version: Latest downloaded by Arduino today
Arduino IDE version: 2.0
Host OS and Version: KDE Plasma (Linux 5.19.0)
CPU Hardware model/type: Teensy 2.0++
Matrix hardware model/type: [ ] Parola [ ] Generic [ ] ICStation [ ] FC-16 [x] Custom (describe how wired)
Explain how to reproduce this issue. Please provide working code below to demonstrate the issue.
Explain what should happen.
Explain what happens instead. Provide log messages if relevant.
This is how I mapped out the rows/cols
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW
#define MAX_DEVICES 1
#define CS_PIN 20
#define DATA_PIN 22
#define CLK_PIN 21
MD_MAX72XX myRawDisplay = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup() {
Serial.begin(57600);
Serial.print("Starting test...\n");
myRawDisplay.begin();
}
void loop() {
for (int x=0; x < 8; x++) {
for (int y=0; y < 8; y++) {
Serial.print("Turning on row:");
Serial.print(x, DEC);
Serial.print(" col:");
Serial.print(y, DEC);
Serial.print("\n");
myRawDisplay.setPoint(y, x, true);
while(Serial.available() == 0) {
}
int mydata = Serial.read();
myRawDisplay.setPoint(y, x, false);
}
}
}
Scrolling text can leave garbage in-between characters. This is due to the code here:
for (uint8_t i=0; i<=charWidth; i++)
{
mx.transform(MD_MAX72XX::TSL);
if (i < charWidth)
mx.setColumn(0, cBuf[i]);
delay(DELAYTIME);
}
The correct code should be like this (we need to zero out the row explicitly):
for (uint8_t i=0; i<=charWidth; i++)
{
mx.transform(MD_MAX72XX::TSL);
mx.setColumn(0, (i < charWidth) ? cBuf[i] : 0);
delay(DELAYTIME);
}
Thanks for a great library!
i try to modify the library to use some italian chars like 'è' or 'à' or 'ù'...
i found that in the library is already present in MD_MAX72xx_font.cpp
but apparently in the wrong place:
with serial bluetooth adapter i acqwuire the string to print on the display, but in corresponding of chars there is an error:
if i put 'è' i obtain '-¿', if i replace this on line 336:
5, 0x38, 0x54, 0x54, 0x55, 0x59, // 168 - 'Inverted ?
with this (contasined in line 298):
5, 0x38, 0x54, 0x54, 0x55, 0x59, // 130 - 'e acute'
it's look like '-è'
there is another way to correct that?
Before submitting this issue
[X] Have you tried using the latest version of the library?
[X] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum
Error When used on Raspberry Pico
Library Version: Latest
Arduino IDE version: Any
Host OS and Version: Win 11
CPU Hardware model/type:
Matrix hardware model/type: [ ] Parola [ ] Generic [ ] ICStation [X ] FC-16 [ ] Custom (describe how wired)
Explain how to reproduce this issue. Please provide working code below to demonstrate the issue.
Upload any code that works on Arduino uno/nano it will not work on Pico
Explain what should happen.
Load Example hello code, Hello should display
Explain what happens instead. Provide log messages if relevant.
Just get a few LED flickering very fast on top or bottom line in center
Insert your compilable code here (no code snippets).
````// Program to demonstrate the MD_Parola library
//
// Simplest program that does something useful - Hello World!
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 11
#define CLK_PIN 18
#define DATA_PIN 19
#define CS_PIN 7
// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary output pins
// MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
void setup(void)
{
P.begin();
}
void loop(void)
{
if (P.displayAnimate())
P.displayText("Hello", PA_CENTER, P.getSpeed(), P.getPause(), PA_SCROLL_DOWN, PA_SCROLL_UP);
}
```
Hi. I want to make a watch with a dot matrix display, which also has a web interface where I can set various things. Among the settings in the web interface, I want to be able to set the type of hardware and the number of matrices used. How can I change these data in code (in loop) if the display is already initialized. I use a Wemos D1 mini. An image with the web interface: https://i.imgur.com/eqHtoRf.png When I change the hardware type in the web interface, for the hardware type I get an integer variable 1, 2, 3, 4. Depending on these numbers I want to initialize the display with different types of hardware, so that my code can be used on different types of hardware. For Max_Devices from the web interface, I get an integer variable from the web interface, depending on which to set (on the fly) Max_devices from the code. I mention that the display is initialized as follows:
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN 14
#define DATA_PIN 13
#define CS_PIN 15
MD_Password P = MD_Password(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
Before submitting this issue
[ ] Have you tried using the latest version of the library?
[ ] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum
Describe your issue here.
Library Version:
Arduino IDE version:
Hardware model/type:
OS and Version:
Explain how to reproduce this issue. Please provide working code below to demonstrate the issue.
Explain what should happen.
Explain what happens instead. Provide log messages if relevant.
Insert your code here.
Hello MD Parola, I have been using your MD_MAX72xx Message Serial successfully to control an LED banner from the Arduino suite Serial Monitor, i'm wanting to do the same via the Rx/Tx pins on the board. I have RS-232 converted to TTL and would like the LED banner to display the ASCii characters I send via my PLC controller to RS-232 output. I found the below link on the Arduino side and suspect I have to include the same serial library, specify which serial port to use in your code, and then maybe make some other minor modifications.
https://www.arduino.cc/en/Reference/SoftwareSerialRead
Do you have any suggestions on how to proceed or do you have any examples you could share?
Apologies before I start writing this question. Might sound trivial but I am looking a simple way to print öäåÖÄÅ (swedish) characters on 8x8 LED (MAX7219) .
Let's say if I take MD_MAX72XX_PrintText from examples and replace output text with this
char message[BUF_SIZE] = {"HelloÅ"};
then I get a "Hello |-" instead of HelloÅ
How in an easy can this be achieved ?
Surely I am not the first one who have asked as these characters are common in many european languages. But I cannot find a readily available solution.
thanks for writing this ... just fyi when running this program the calls to set column sometimes return false when idx-DATA_WIDTH = 65501 to 65535 ( i am running on an Arduino UNO R4 WiFi) ... this is the first example i looked at and im trying to figure out if you intended to use this range
I just compile but my ip not show web respond and also web page
are you sure that's correct ?
please you try its not working trust me
I have a string of 40 MAX7219 controlled matrices which I'm attempting to control using an Arduino Mega 2560 R3 and the MD_MAX72XX library.
I've used the print_test sample code to get my matrices to display a string of characters ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"). Everything works correctly as I change MAX_DEVICES to values in the range 1-32 (as expected, the sequence repeats when the physical string of matrices is longer than MAX_DEVICES):
However, when I change MAX_DEVICES to a value >32, the subsequent matrices are not controlled.
MAX_DEVICES = 36:
MAX_DEVICES = 40:
MD_MAX72xx_Message_Serial example does not load characters > 127
Include the degree symbol (\220) in a message string.
Degree character scrolled out
Garbage bits scroll out
This is due to line 98 in scrollDataSource. char *p loads a negative value and indexes the font table incorrectly. I fixed it locally by casting (uint8_t)*p++.
Does anyone know how to display custom sprites on the MAX7219 using the MD_MAX72xx and MD_PAROLA libraries?
Just a quick question if you know how to get custom version of the popular 32x8 dot matrix boards powered with 4 max7219 chips. They are so cheap on amazon but I want one with a built in esp32 or at least with straight headers instead of 90 degree headers. Any ideas ?
Before submitting this issue
[x] Have you tried using the latest version of the library?
[x] Have you checked this has not already been submitted and/or resolved?
[x] If you are requesting help a better choice may be the Arduino forum
Trying to compile MD_MAX72xx
for Nano 33 BLE gives errors that SPI is not defined. This is because #30 introduces compatibility with mbed. The Arduino Nano 33 BLE also runs mbed, and this causes the__MBED__
macro to be defined.
A possible solution to this would be to check for #ifndef Arduino_h
and only check for elseif __MBED__
. Although I'm not experienced with arduino and I'm not sure this would be bad practice.
When removing the __MBED__
directives, I succeed to compile, but I haven't deployed it yet on a target.
I'm happy to work on a solution, but wanted to check what you think would be a good way forward?
Library Version: 3.2.4
Arduino IDE version: 1.8.13
Hardware model/type: Arduino Nano 33 BLE
OS and Version: Mac OS Big Sur
Compile the below block for Arduino Nano 33 BLE
Should just compile.
Gives following error
Arduino: 1.8.13 (Mac OS X), Board: "Arduino Nano 33 BLE"
In file included from /var/folders/b0/57dvvvtn5l93d5m84k7vfrzh0000gn/T/arduino_modified_sketch_871210/BareMinimum.ino:1:0:
/Users/tim/Documents/Arduino/libraries/MD_MAX72XX/src/MD_MAX72xx.h:998:3: error: 'SPI' does not name a type; did you mean 'SPIS'?
SPI _spi; // Mbed SPI object
^~~
SPIS
/Users/tim/Documents/Arduino/libraries/MD_MAX72XX/src/MD_MAX72xx.h:999:3: error: 'DigitalOut' does not name a type; did you mean 'digitalRead'?
DigitalOut _cs;
^~~~~~~~~~
digitalRead
exit status 1
Error compiling for board Arduino Nano 33 BLE.
#include <MD_MAX72xx.h>
#include <SPI.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
I don't understand how to use 1088B LED matrices with FC-16 boards with this library.
What do I need to change in the library?
When using the 1088A, I have to insert the LED matrices upside down.
Hey there @MajicDesigns,
When testing the example scripts, the text displays in a wrong order.
When googling for this issue i found that you have to change
#define USE_PAROLA_HW 1
To
#define USE_PAROLA_HW 0
but the problem is that the line you have to edit is not present in the file. (MD_MAX72xx.h).
How do i fix this? or is there something im missing?
Thanks in advance :)
003random,
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.