Pages: [1]   Go Down
Author Topic: Scroll text with MAX7217 and Ledcontrol  (Read 1742 times)
0 Members and 1 Guest are viewing this topic.
Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

I search whole Internet and not found any examples how to do scroll message with ledcontrol. I try it myself, and have some problems.

My code:
Code:
#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1);

void setup() {
  lc.shutdown(0,false);
  lc.setIntensity(0,1);
  lc.clearDisplay(0);
}

const byte a[6]={B01111110,B10001000,B10001000,B10001000,B01111110,B00000000};
const byte r[6]={B00111110,B00010000,B00100000,B00100000,B00010000,B00000000};
const byte d[6]={B00011100,B00100010,B00100010,B00010010,B11111110,B00000000};
const byte u[6]={B00111100,B00000010,B00000010,B00000100,B00111110,B00000000};
const byte i[6]={B00000000,B00100010,B10111110,B00000010,B00000000,B00000000};
const byte n[6]={B00111110,B00010000,B00100000,B00100000,B00011110,B00000000};
const byte o[6]={B00011100,B00100010,B00100010,B00100010,B00011100,B00000000};

void display(const byte letter[6]) {
 int i,j,k = 0;
  for (i=8; i>=0; i--) {
  for (j=0; j<6; j++) {
      lc.setRow(0,j+i,letter[j]);
      }
      delay(150);
}
}

void scroll(char * s) {
  int var=0;
  while (s[var]) {
    if (s[var]=='A')
      display(a);
    if (s[var]=='R')
      display(r); 
    if (s[var]=='D')
      display(d);   
    if (s[var]=='U')
      display(u);   
    if (s[var]=='I')
      display(i);
    if (s[var]=='N')
      display(n);
    if (s[var]=='O')
      display(o);
    var++;
  }
}

void loop() {

scroll("ARDUINO");
}

and effect:


I would get a better result, like

but no idea how to that.
Logged

Best Regards, Artur

Australia
Offline Offline
Full Member
***
Karma: 8
Posts: 161
You dont have to touch powerlines for them to kill you, even looking at them for too long will make them angry.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From the looks of it, you arent clearing the buffer of the values used before, you are just overwriting the current letter.
Logged

"Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent di

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Any luck with scrolling text? I'm trying to accomplish same thing, and have no problem with scrolling one letter, but when it comes to text, I'm stuck smiley-sad
Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Any luck with scrolling text?

That depends on how you scroll a single 8x8 image.
Logged

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 518
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi  arteqw ,

have a look at the second and third posts on this thread
http://arduino.cc/forum/index.php/topic,126712.0.html
Pedro.
Logged


Pages: [1]   Go Up
Jump to: