Go Down

Topic: how to scroll text on 8x8 dot matrix (Read 714 times) previous topic - next topic


hi i need your help please !

i wrote this code on arduino and it works good and shows HI on the 8x8 dot matrix now im trying to scroll it?

this is my code ;

Code: [Select]

const char font[8] ={
B00000000};   // displays  HI

void setup() {               
  DDRD = B11111111;
  DDRB = B11111;
  DDRC = B111;

void sendbyte(unsigned char scan){
         PORTB= ~ font[scan];            // send first 5bits of 1 byte
         PORTC= ~ font[scan] >>5;        // send the last 3 bits of 1 byte
          PORTB= ~ B00000;             // clear display
          PORTC= ~ B000;               // clear display

void loop() {
  for ( char scan = 0;scan < 8;scan++){
          PORTD = 1 << scan;   // scan
            sendbyte(scan);    // send data sync to scaning bits

thank you;


How do you want to scroll it? Left or Right? Do you just want to move it off the screen or rotate through?

You need to understand the << and >> operators in C - this will move the bits in a byte/word/long to the left or right by the specified number of positions. Scrolling is just moving bits the way your characters are defined.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up