Go Down

Topic: how to scroll text on 8x8 dot matrix (Read 627 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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131