Pages: 1 ... 19 20 [21]   Go Down
Author Topic: Scrolling LED matrix display - Parola for Arduino  (Read 52881 times)
0 Members and 2 Guests are viewing this topic.
Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2740
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

marco,
Go get the latest IDE. and you will see the issue.
The AVR progmem stuff has changed.
The older compiler was a bit loose on what it allowed.
(It allowed improper usages).
The new compiler is much more strict and so you must declare progmem
references properly.
This is affecting many libraries.
The references on the Arduino page for the AVR progmem stuff is wrong
and should not be used as a model.

All progmem declarations need to be const.

--- bill

Logged

New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Marco, I can confirm that it is an issue with the IDE as Bill suggests.

I tried the syntax changes you suggested and it made no difference when using MacOS IDE 1.5.7b or the nightly build. But when I dropped back to IDE 1.0.5 it compiled just fine. Which is a bit of a shame because while my Robotale Uno R3 board is OK with 1.0.5, I also have a temperamental Makerduino Uno that just won't talk to 1.0.5 ...

Now I have other problems, but there's plenty of documentation so I'll try and fix them on my own first.

Thank you both for the quick replies.

Andrew
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2740
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried the syntax changes you suggested and it made no difference when using MacOS IDE 1.5.7b or the nightly build
Which changes?
When the PROGMEM declarations are all corrected it will compile.
There are several.
You must correct the _sysfont_var[] declarations in MD_MAX72xx_lib.h and MD_MAX72xx_font.cpp
as well as the fontType_t typedef in MD_MAX72xx.h

marco, there are also some other examples that don't compile.
The best thing will be to go get the 1.5.7 IDE, which uses the newer gcc compiler
and then compile all the examples with verbose enabled.

--- bill
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1285
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The IDE v1.5.7 PROGMEM issue has been fixed in both MD_MAX72xx and MD_Parola libraries. It should still work for IDE 1.0.5, but I have not tested this.

Code is uploaded to the Source Code section of the Codeplex website (ie, where the files are listed individually). The Downloads section contains the last official release as a zip file and will be updated with these changes at the next full release.
« Last Edit: September 14, 2014, 02:26:19 am by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2740
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

marco,
There are some other errors in the examples, like Parola_Test  doesn't compile.
It is looking for MD_KeySswitch.h which doesn't seem to exist.

Also looks like is are some kind of issue with Parola_Fonts.ino
That one is REALLY strange.
Here is the error where things start to go down hill (there are many more errors
but these are the issue:)
Code:
Parola_Fonts.ino:1:1: error: stray '\' in program
Parola_Fonts.ino:1:2: error: 'ufeff' does not name a type

And now here is the top of the .ccp file the IDE created from your .ino file:
Code:
#line 1 "Parola_Fonts.ino"
#include "Arduino.h"
void setup(void);
void loop(void);
#line 1
\ufeff
#include <MD_Parola.h>
#include <MD_MAX72xx.h>

#include "Parola_Fonts_data.h"

If I look at the hex dump of the .ino file it looks like there is some kind
of extended character (utf8 perhaps) that is in the source module right at the
beginning of the file.
I can't see anything in my editors nor can I remove it.
Here is a hex dump from the first part of the .ino file:
Code:
00000000  ef bb bf 2f 2f 20 50 72  6f 67 72 61 6d 20 74 6f  |...// Program to|
00000010  20 65 78 65 72 63 69 73  65 20 74 68 65 20 4d 44  | exercise the MD|
00000020  5f 50 61 72 6f 6c 61 20  6c 69 62 72 61 72 79 0a  |_Parola library.|
00000030  0a 23 69 6e 63 6c 75 64  65 20 3c 4d 44 5f 50 61  |.#include <MD_Pa|




--- bill
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1285
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm. It all worked compile and tested here before I put it on  the Git server.  Could it be something to do with the upload?

No longer at the computer, so will need to get to it later.

Keyswitch is a library on the repository. I assuming the double s is a typo?
« Last Edit: September 14, 2014, 04:47:02 am by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,
Great library, I have tested it, and its works on Teensy 3.1 with soft mode SPI
For those who have error about MD_KeySwitch doesn't exist, You shoud download it first, rename the zip as, i.e. : MD_keyswitch.zip, then add to the library.
The link for MD_KeySwitch library is here : http://arduinocode.codeplex.com/downloads/get/816718
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First - thank you so much, Parola is awesome! I have been able to get it to work with one 8x8 LED matrix.  It was so fun I ordered three more, so I can have 4 of them.

I am not quite sure how to hook up two, but following the directions here I have been able to get 3 matrices to light up.  (Note, I am using the Parola example, "Parola_Scrolling", not the code from that tutorial - I only referenced that for how to link them). ...except, the text is 'upside down'. 

I have attached a picture so you can see what I mean - is there a way via the code to 'flip' it?  I know I could re-wire the whole thing, but I was curious (and to learn) if there's a way to just flip the text over (mirror it?). 

Thanks so much for any advice/help!


* ex1.jpg (70.72 KB, 388x260 - viewed 6 times.)

* ex2.jpg (74.83 KB, 388x260 - viewed 5 times.)
« Last Edit: September 17, 2014, 07:05:59 pm by Piethon » Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1285
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hardware type is done through changing the MD_MAX72xx library to suit. Your modules are the generic ones. Read the doc that come with the lib.
« Last Edit: September 19, 2014, 03:19:42 pm by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hardware type is we through changing the MD_MAX72xx library to suit. Your modules are the generic ones. Read the doc tha come with the lib.

I looked through it, but I'm new to Arduino - especially libraries and .h files.  What would I be looking for? From what I am understanding, I need to edit something in the MD_MAX72xx_lib.h file?  Searching for "generic" I see that I need to put the MAX7219 on the top....but is there no way to flip the letters via the code (instead of a hardware flip)?

Since I have a generic one, I am now using the GENERIC code:

Code:
// HARDWARE SPI
//MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);
// GENERIC SPI
MD_Parola P = MD_Parola(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
...but that's just editing the Parola_Scrolling.ino , not a library edit.

I also checked the MD_MAX72xx.h and it's set to:
Code:
\def USE_GENERIC_HW
 Set to 1 to use 'generic' hardware modules commonly available, with
 connectors at the top and bottom of the PCB, available from many sources.
 */
#define USE_GENERIC_HW 1

So basically, it doesn't seem there is a way to just flip/mirror the text. I need to actually flip the LEDs on the breadboard?

If you can code/program it, what would I be looking for?  smiley-red

« Last Edit: September 18, 2014, 05:52:50 pm by Piethon » Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 93
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your displays look like the standard ones off eBay, but it looks like the displays are upside down. The wiring for Parola feeds from the right most display, to the left. Not left to right like we normally read.

This is how I use my eBay ones. From the Arduino to the extreme right hand display. Then daisy chain the remaining ones to it.



I soldered pins that go straight out the back of the displays.

I also bought some different ones off eBay that designed to be wired together with jumper pins because the board pins align with each other. However with the LED libraries I couldn't use them that way so I just rotated them and used wired jumpers. The blue matrix ones are significantly smaller PCB's than the previous set and again are wired right to left as well:




So just flip that whole breadboard upside down and you're good to go... smiley-grin

Mel
« Last Edit: September 19, 2014, 10:12:43 am by wabbitguy » Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1285
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wabbit guy has covered the obvious - flip the matrices over.

Generic matrices does not mean that you have to use the 'generic' SPI interface - you can use the hardware SPI and I would encourage that as it is much faster. The hardware setting USE_GENERIC_HW is the right setting to use.

The documentation I referred to is in the doc\html folder (open index.html). The extract that is relevant for you is
Quote
Module Interconnections
-----------------------
Generic modules need to be oriented with the MAX7219 IC at the top and connected using
short patch cables in a spiral pattern. The display is oriented with the IC at the top.
« Last Edit: September 19, 2014, 03:33:39 pm by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to WabbitGuy and Marco_c for your help!  I went ahead and flipped them over and it works wonderfully.  smiley-mr-green

I will also probably take WabbitGuy's idea of soldering and do that in the future.

But, just for knowledge, it looks like trying to 'invert' the text via the code would be WAY much more trouble than just flipping the LEDs, yeah? (In other words, it's not just I would do something like make a variable negative to flip the text...it would be more of a rewriting the library?)

Anyways, thanks again, and thanks a TON for Parola, it's awesome.  smiley-lol
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

An additional question -

I am trying to get a distance, as read from the PING Ultrasonic distance sensor, to be sent to the LCDs.  However, I can't figure out how to get the INT received from my function to scroll by.  Since the new message is determined by an entry to the Serial monitor, followed by a newline, I thought "Serial.println()" would work, but it doesn't seem to.

Here's my function, and the print function:

Code:
void measureDistance()
{
  // set pin as output so we can send a pulse
  pinMode(signal, OUTPUT);
  digitalWrite(signal, LOW);
  delayMicroseconds(5);
  digitalWrite(signal, HIGH);
  delayMicroseconds(5);
  digitalWrite(signal, LOW);
  pinMode(signal, INPUT);
  pulseduration=pulseIn(signal, HIGH) / 2;
  distance = int(pulseduration/29);
  indistance = distance*.39; 
 
}


void printDistances(){            // This is placed in loop()

//  Serial.print(indistance);
  static uint8_t putIndex = 0;
  if ((indistance + 10) <= curdistance || (indistance - 5) >= curdistance)
    {curdistance = indistance;   
      Serial.print("Distance - ");
      Serial.println(curdistance);     // <<<<<<<< I'm trying to get this value printed to the LCD, with the above "Distance - "
    }
}

I've looked around, and it looks like I need to change the int to something else - but doing something like

Code:
String myString = String(curvalue)
isn't working.  I need to do something with 'char'?

Thanks for any help. Again, I'm new so sorry if I'm missing something obvious.
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 93
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The obvious would be that you assumed Serial.print has something to do with a scrolling LED matrix. Not sure how you arrived at that, but as you found out, it doesn't... smiley-confuse Serial.print is strictly for serial, like data down the USB cable to your computer.

To display things with Parola, there are numerous example files included when you installed the MD_Parola library. Have you looked at the examples to see how the scrolling messages are implemented?

For the INT to char, look up sprintf. Very useful to know.

Mel
Logged

Pages: 1 ... 19 20 [21]   Go Up
Jump to: