Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« on: September 21, 2012, 01:44:43 am » |
I came across this code on the forum for Max 7221 for scrolling text. http://arduino.cc/forum/index.php/topic,22305.0.htmlI believe that the 7221 and 7219 are very similair and I only currently have the 7219 so if this code works with the 7221 is it conceivable that it would also work with 7219. In the link to Youtube the uploader says that "It currently does not work with Arduino 1.0 only 0023." Obviously I am currently using Arduino 1.0 but I would like to try the code out. My question is can I have two different versions of the Arduino IDE installed on my computer at once and just use the version applicable to the code that I wish to run. The only other thought that I had was that I think that I read that previous versions of the IDE used .pde rather than .ino files If this is indead the case, and version 023 requires .pde files, do I just copy and paste the code into the Processing text editor which will and save it as .pde and then copy and paste that into the Arduino IDE. Thanks for reading Pedro.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #1 on: September 21, 2012, 03:57:58 am » |
Yes, I have both versions installed, in different folders.
|
|
|
|
|
Logged
|
|
|
|
|
Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« Reply #2 on: September 21, 2012, 04:13:24 am » |
Thanks for that Nick
|
|
|
|
|
Logged
|
|
|
|
|
Norfolk UK
Offline
Edison Member
Karma: 23
Posts: 1320
|
 |
« Reply #3 on: September 21, 2012, 06:38:27 am » |
A quick look and only thing I can see that would make it not work on v1.0+ is the LedControl library and AFAIK it has since been updated to be 1.0+ compatible. Attached is a demo code I did for 2x MAX7219 chips arranged as a 16x8 matrix. I have since updated it to kern the fonts but don't have the code here with me at work.
|
|
|
|
|
Logged
|
|
|
|
|
Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« Reply #4 on: September 21, 2012, 04:51:33 pm » |
Thanks Riva iI would like to try your latest code for 2x MAX7219 chips arranged as a 16x8 matrix and would it be possible to give me a copy of the schematic, thank you Pedro
|
|
|
|
|
Logged
|
|
|
|
|
Norfolk UK
Offline
Edison Member
Karma: 23
Posts: 1320
|
 |
« Reply #5 on: September 22, 2012, 02:46:06 am » |
Thanks Riva iI would like to try your latest code for 2x MAX7219 chips arranged as a 16x8 matrix and would it be possible to give me a copy of the schematic, thank you Pedro I had attached the test code and it's library to the previous post but the final code that also does kerning and all other relevant files/info including schematics are in this thread http://arduino.cc/forum/index.php/topic,118338.0.htmlDue to the layout of the 16x8 matrix I have, the font was doubled in width from a 5x7 to 10x7. I have attached the kerning test code using the 5x7 font but it's output was written to drive a Rainbowduino but should be relativity easy to adapt to the MAX7219.
|
|
|
|
|
Logged
|
|
|
|
|
Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« Reply #6 on: September 22, 2012, 04:33:32 am » |
Thanks Riva,
I have seen your impressive clock before and I forgot about it and the code so thanks again,
Pedro
|
|
|
|
|
Logged
|
|
|
|
|
Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« Reply #7 on: September 28, 2012, 01:32:08 am » |
Hello Riva,
I just got around to trying your ScrollTest2 code for the Max7219. Very impressive work and thank you so much for sharing all your hard work,
Pedro.
|
|
|
|
|
Logged
|
|
|
|
|
Norfolk UK
Offline
Edison Member
Karma: 23
Posts: 1320
|
 |
« Reply #8 on: September 28, 2012, 03:56:52 am » |
I just got around to trying your ScrollTest2 code for the Max7219. Very impressive work and thank you so much for sharing all your hard work No problem. Community is about sharing and helping.
|
|
|
|
|
Logged
|
|
|
|
|
Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« Reply #9 on: September 29, 2012, 09:04:41 pm » |
I am having a little trouble with a Max 7219 controlling an 8 x 8 LED matrix. I have previously constructed one as a hardwired cicuit so I know that the code and circuit schematic (Nick Gammons) are good. http://www.gammon.com.au/forum/?id=11516 I am now trying to cascade two 7219's and have built a second circuit on a breadboard to connect up to the aforementioned hardwired circuit but the problem that I am having is that when I upload a sketch to the breadboard circuit (which at this stage is a standalone circuit) it displays the first character perfectly (so the matrix is correctly wired) and then nothing unless I press reset or upload the code again. I have checked my wiring ,and that the one polarised 10 mf cap is correct etc but cannot find a problem. Any clues would be appreciated, Pedro. Update - now the problem gets more Gremlinesque  one two char sketch is displaying correctly but others are still reacting as initially described ?
|
|
|
|
« Last Edit: September 29, 2012, 09:22:36 pm by Pedro147 »
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #10 on: September 29, 2012, 09:33:42 pm » |
Show your code please.
|
|
|
|
|
Logged
|
|
|
|
|
Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« Reply #11 on: September 29, 2012, 09:49:30 pm » |
It is your code from the link I posted in the question Nick - #include <SPI.h> #include <avr/pgmspace.h> #include "font.h"
// define max7219 registers const byte MAX7219_REG_NOOP = 0x0; const byte MAX7219_REG_DIGIT0 = 0x1; const byte MAX7219_REG_DIGIT1 = 0x2; const byte MAX7219_REG_DIGIT2 = 0x3; const byte MAX7219_REG_DIGIT3 = 0x4; const byte MAX7219_REG_DIGIT4 = 0x5; const byte MAX7219_REG_DIGIT5 = 0x6; const byte MAX7219_REG_DIGIT6 = 0x7; const byte MAX7219_REG_DIGIT7 = 0x8; const byte MAX7219_REG_DECODEMODE = 0x9; const byte MAX7219_REG_INTENSITY = 0xA; const byte MAX7219_REG_SCANLIMIT = 0xB; const byte MAX7219_REG_SHUTDOWN = 0xC; const byte MAX7219_REG_DISPLAYTEST = 0xF;
void sendByte (const byte reg, const byte data) { digitalWrite (SS, LOW); SPI.transfer (reg); SPI.transfer (data); digitalWrite (SS, HIGH); } // end of sendByte void letter (const byte c) { for (byte col = 0; col < 8; col++) sendByte (col + 1, pgm_read_byte (&cp437_font [c] [col])); } // end of letter void showString (const char * s, const unsigned long time) { char c; while (c = *s++) { letter (c); delay (time); letter (' '); // brief gap between letters delay (10); } } // end of showString
void setup () { SPI.begin (); sendByte (MAX7219_REG_SCANLIMIT, 7); // show all 8 digits sendByte (MAX7219_REG_DECODEMODE, 0); // using an led matrix (not digits) sendByte (MAX7219_REG_DISPLAYTEST, 0); // no display test // clear display for (byte col = 0; col < 8; col++) sendByte (col + 1, 0);
sendByte (MAX7219_REG_INTENSITY, 7); // character intensity: range: 0 to 15 sendByte (MAX7219_REG_SHUTDOWN, 1); // not in shutdown mode (ie. start it up) } // end of setup void loop () { showString ("PEDRO ", 600); } // end of loop There seems to be no pattern to this problem, some code displays ok and some doesn't. It is definitely a hardware or Arduino sofware issue IMHO (extremely humble  )
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #12 on: September 29, 2012, 09:58:41 pm » |
Can you describe the problem in more detail? You have two LED matrices, right? One connected to one 7219 and the other to the other 7219? And how have you connected to the two 7219s together?
When you say "some code displays ok" can you be more explicit?
Your code displays "PEDRO" so do you see "P" on one and "E" on the other? Or what, exactly?
|
|
|
|
« Last Edit: September 29, 2012, 10:01:02 pm by Nick Gammon »
|
Logged
|
|
|
|
|
Canberra Australia
Offline
Sr. Member
Karma: 5
Posts: 273
Enthusiastic Newbie
|
 |
« Reply #13 on: September 29, 2012, 10:13:21 pm » |
I do have one circuit hardwired that works perfectly ok. I am now constructing exactly the same circuit on a breadboard so I can eventually daisy chain the two together to scroll text effectively as a 16 x 8 matrix. The circuit on the breadboard is the problem one in so far as it works with one ( two character) code example (using your code with what I want displayed in showString) but another block of exactly the same code but with different characters in showString, briefly displays the first character of showString and the the display remains blank.
|
|
|
|
|
Logged
|
|
|
|
|
Norfolk UK
Offline
Edison Member
Karma: 23
Posts: 1320
|
 |
« Reply #14 on: September 30, 2012, 01:27:45 am » |
I am having a little trouble with a Max 7219 controlling an 8 x 8 LED matrix. I have previously constructed one as a hardwired cicuit so I know that the code and circuit schematic (Nick Gammons) are good. If you have the 2x MAX7219 chips wired as per my clock schematic then the ScrollTest2.ino posted above is configured for a pair of MAX7219 chips and should work okay.
|
|
|
|
|
Logged
|
|
|
|
|
|