Go Down

Topic: Scroll text with MAX7217 and Ledcontrol (Read 1 time) previous topic - next topic

arteqw

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: [Select]

#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:
http://www.youtube.com/watch?v=txp1ZnBcYo4

I would get a better result, like
http://www.youtube.com/watch?v=B2Vu69B6FfU
but no idea how to that.
Best Regards, Artur

fliggygeek

From the looks of it, you arent clearing the buffer of the values used before, you are just overwriting the current letter.
"Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent di

bratan

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 :(
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

dhenry

Quote
Any luck with scrolling text?


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

Pedro147

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.

Go Up