Go Down

Topic: LED matrix display - MD_Parola, MD_MAX72xx and MD_MAXPanel (Read 457550 times) previous topic - next topic

iottoman

@iottoman: You may want to look at the code for that type of scrolling in the MD_MAX72xx library examples (Pushwheel).
Yes, this is kind of code I was thinking about. A bit complicated task though...

BTW what is the reason for different animation types in vertical and horizontal scrolling in Parola?
As I see it, the only difference is screen clearing before scrolling in vertical modes.
But its very easy to add screen clearing, if needed, with displayClear();
Doing vertical scroll manually is much more difficult...

iottoman

readers may be interested in this excellent instructable that I have downloaded and are now playing with, as follows:
https://www.instructables.com/id/ESP8266-Internet-Clock-With-Weather-Update-Many-Mo/
Well, I've seen many clock projects, and I should say I'm not particularly impressed with this one...
First, powering the clock from 12 volts supply and using 2 voltage regulators for 5V and 3.3V is rather silly. Two LED modules may need up to 1A of current, so 5V regulator will dissipate up to 7 watts, producing a lot of heat in clock case and wasting the energy. 5 volts supply would be much more efficient. 
Second, NTP server functionality is natively supported by time.h library, which comes with ESP8266 core.
So it could be activated with just one line of code like this:

configTime(3600*timeZone, DST, "pool.ntp.org", "time.nist.gov");

You may also have a look at this clock project:
https://github.com/Qrome/marquee-scroller

Sorry, this is rather off-topic discussion
 

marco_c

Quote
BTW what is the reason for different animation types in vertical and horizontal scrolling in Parola?
As I see it, the only difference is screen clearing before scrolling in vertical modes.
Yes, looks like the horizontal scrolling should clear the display before it starts. That would make it consistent across all scrolling modes.

Quote
Doing vertical scroll manually is much more difficult...
Not true.
Code: [Select]
P.displayText(curMessage, PA_CENTER, scrollSpeed, scrollPause, PA_NO_EFFECT, PA_SCROLL_UP);

Quote
Sorry, this is rather off-topic discussion
Yes, this is entirely unrelated and I will ask moderators to delete any future posts on the topic. This thread is big enough without off topic side discussions making it even bigger.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

iottoman

I found another very strange bug in Parola.

From Parola functions I'm only using scrolling - up, down and left. Parameter scrollPause is set to zero in variable definition in the beginning of sketch.

But after approximately 10-12 hrs of operation scroll type suddenly changed itself, and now it looks like scrollPause parameter is about 5-8 seconds. Pause is clearly seen on scrolling messages, both vertical and horizontal.

I double-checked the code and absolutely sure, that scrollPause parameter is set to zero.
I have two clocks with Parola library, and both show the same behaviour...


marco_c

Hard to comment sensibly without knowing what else your code does.

I have tested the Parola_Test programs for over a week running and it ran with no problems. There are others that also have long running applications that do not have issues with the library.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

chlor

Hi marco_c. I just tried MD_Parola and it looks great.

There is one function I can not find: Can the FC-16 display be turned upside-down (turn 180°)?

I have already build the box where display is going to be and I chose the same direction as the text has on the back side.

marco_c

Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

chlor

It works! It turned 180°

Code: [Select]

  P.setZone(0, 0, MAX_DEVICES-1);
  P.setZoneEffect(0, true, PA_FLIP_UD);
  P.setZoneEffect(0, true, PA_FLIP_LR);


BTW: It seems like some files are missing in the documentation. When going setZoneEffect() and clicking at zoneEffect_t one get an 404 error.

shah123

Could anyone tell me what wifi capable device (ESP etc) I can use to drive three 4x max7219 panel display?

About a couple of years ago I made a 3 panel LED display with Arduino and it is still working.  At that time I tried to use ESP based boards but none of them were able to drive the LEDs.  Probably could not provide enough current or something.  Ended up in using an Arduino Uno to drive it.

Now I have to make another one, and this time I want to make it wifi capable so that I can program it wirelessly.

Anyone has done that?  Any help will be appreciated.

There is no need to power the leds from the MCU, you can use an external power supply instead of relying in the power from the USB plug. Note that the ESP8266 will need 3.3V but the led matrices will want 5V.
--
You never learn anything by doing it right.

shah123

There is no need to power the leds from the MCU, you can use an external power supply instead of relying in the power from the USB plug. Note that the ESP8266 will need 3.3V but the led matrices will want 5V.
So then I will have to use two power supplies in the whole system?  

Do I have to connect their grounds together?  

Would max7219 work on 3.3V (on SPI data/control lines)?


So then I will have to use two power supplies in the whole system?  

Do I have to connect their grounds together?  

Would max7219 work on 3.3V (on SPI data/control lines)?


That will depend of the 8266 module you're using. Most, except the basic ones like the ESP01s will have a regulator and you can feed them the same 5 V you're using to power the leds.
I have done some work (well play around really) with an ESP8266 and 4 led matrices all at 3.3V, then some day the matrices started acting strangely, it took some time for me to find that they worked ok if I power them with 5V.
And I was not powering the matrices from the ESP, I was using one bread board power supply set to 3.3V.
The communication between the ESP8266 and the matrices worked as it was before, so I guess the matrices (at least the ones I was using) will accept 3.3V signalling. But there are level converters available so that's an option anyway.


One thing that can go wrong and always get me worried is when uploading new code via usb, you may have to disconnect the external power supply, and disconnect the usb cable to run the program.
--
You never learn anything by doing it right.

dcdenison

Thanks for the great libraries. I'm working with Max7219s. Ordering them via AliExpress.

Cosha

I am trying to add basic text animations, but finding it hard.

The code i am using is below.
I suspect that Parola doesn't like strings and would prefer sprintf()

Am i close to making this work with the fantastic Parola library?
Everything works apart from the text animations  :smiley-confuse:

Code: [Select]


#include "InstagramStats.h"

 // ----------------------------
 // Standard Libraries - Already Installed if you have ESP8266 set up
 // ----------------------------

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#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::FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN   14  // or SCK
#define DATA_PIN  13  // or MOSI
#define CS_PIN    15  // or SS
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }

#define SPEED_TIME  25
#define PAUSE_TIME  1000

// Turn on debug statements to the serial output
#define  DEBUG  1

#if  DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTX(x) Serial.println(x, HEX)
#else
#define PRINT(s, x)
#define PRINTS(x)
#define PRINTX(x)
#endif

// 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);

// ----------------------------
// Additional Libraries - each one of these will need to be installed.
// ----------------------------

#include "JsonStreamingParser.h"
// Used to parse the Json code within the library
// Available on the library manager (Search for "Json Streamer Parser")
// https://github.com/squix78/json-streaming-parser

//------- Replace the following! ------
char ssid[] = "MY_SSID";       // your network SSID (name)
char password[] = "PASSWORD";  // your network key

WiFiClientSecure client;
InstagramStats instaStats(client);

unsigned long delayBetweenChecks = 10000; //mean time between api requests
unsigned long whenDueToCheck = 0;



uint8_t  inFX, outFX;
textEffect_t  effect[] =
{
  //PA_PRINT,
  //PA_SCAN_HORIZ,
  //PA_SCROLL_LEFT,
  //PA_WIPE,
  //PA_SCROLL_UP_LEFT,
  //PA_SCROLL_UP,
  //PA_OPENING_CURSOR,
  //PA_GROW_UP,
  //PA_MESH,
  //PA_SCROLL_UP_RIGHT,
  PA_BLINDS,
  //PA_CLOSING,
  //PA_RANDOM,
  //PA_GROW_DOWN,
  //PA_SCAN_VERT,
  //PA_SCROLL_DOWN_LEFT,
  //PA_WIPE_CURSOR,
  //PA_DISSOLVE,
  //PA_OPENING,
  //PA_CLOSING_CURSOR,
  //PA_SCROLL_DOWN_RIGHT,
  //PA_SCROLL_RIGHT,
  //PA_SLICE,
  //PA_SCROLL_DOWN,
};

//Inputs

String userName = "User_Name"; // from their instagram url https://www.instagram.com/brian_lough/
String W = "Wifi";
String N = "Name";

//////////////////////////////////

void setup() {

  Serial.begin(115200);
  P.begin();

  // Set WiFi to station mode and disconnect from an AP if it was Previously
  // connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  // Attempt to connect to Wifi network:
  P.begin();
  P.setInvert(false);
  P.displayText(W, PA_CENTER, SPEED_TIME, PAUSE_TIME, effect[inFX], effect[outFX]);
  Serial.print("Connecting Wifi: ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(5000);
  P.displayClear();

  }

  // When Connected
  P.print (W);
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);
  delay (4000);
  P.displayClear();
}

void getInstagramStatsForUser() {
  Serial.println("Getting instagram user stats for " + userName);
  P.begin();
  P.setInvert(false);
  P.displayText(N, PA_CENTER, SPEED_TIME, PAUSE_TIME, effect[inFX], effect[outFX]);

  P.displayClear();
 
  InstagramUserStats response = instaStats.getUserStats(userName);
  Serial.println("Response:");
  Serial.print("Number of followers: ");
  Serial.println(response.followedByCount);
  P.print(response.followedByCount);
  delay(10000);
  P.displayClear();
}

void loop() {
  P.displayAnimate();
  unsigned long timeNow = millis();
  if ((timeNow > whenDueToCheck))  {
    getInstagramStatsForUser();
    whenDueToCheck = timeNow + delayBetweenChecks;
  }
}

marco_c

Quote
I suspect that Parola doesn't like strings and would prefer sprintf()
There is nothing to suspect here. In all the examples and all the documentation (which I am sure you have read?) there is no mention of any Strings (capital S) and nul terminated character arrays are used throughout, so this is certainty.

Either learn how to convert your Strings before you pass them to the library or learn how to use nul terminated char arrays, which are a better idea for small memory environments without effective heap defragmentation.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up