#include "header.h"
void setup() {
init_port();
volatile char *outf, *outk;
outf = 0x31;
outk = 0x108;
// Define the characters vertically for scrolling right-to-left
unsigned char W[] = {0x82, 0x82, 0x82, 0x82, 0x92, 0xaa, 0xc6, 0x82}; // W
unsigned char e[] = {0x00, 0x78, 0x84, 0x84, 0xfc, 0x80, 0x44, 0x38}; // e
unsigned char l[] = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}; // l
unsigned char c[] = {0x38, 0x44, 0x80, 0x80, 0x80, 0x80, 0x44, 0x38}; // c
unsigned char o[] = {0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38}; // o
unsigned char m[] = {0x00, 0x6c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92}; // m
// Combined vertical columns for "Welcome"
unsigned char text[] = {
// W e l c o m e (with some space)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
W[0], e[0], l[0], c[0], o[0], m[0], e[0], 0x00,
W[1], e[1], l[1], c[1], o[1], m[1], e[1], 0x00,
W[2], e[2], l[2], c[2], o[2], m[2], e[2], 0x00,
W[3], e[3], l[3], c[3], o[3], m[3], e[3], 0x00,
W[4], e[4], l[4], c[4], o[4], m[4], e[4], 0x00,
W[5], e[5], l[5], c[5], o[5], m[5], e[5], 0x00,
W[6], e[6], l[6], c[6], o[6], m[6], e[6], 0x00,
W[7], e[7], l[7], c[7], o[7], m[7], e[7], 0x00
};
const int textLength = sizeof(text); // Total length of the combined text array
const int displayWidth = 8; // Width of the 8x8 matrix display
volatile long i;
char col;
while (1) {
// Loop to scroll the text from right to left
for (int shift = 0; shift <= textLength - displayWidth; shift++) {
for (i = 0; i < 2200; i++) { // Adjust for smooth scrolling speed
for (col = 0; col < 8; col++) {
*outk = ~(1 << col); // Activate the current column
*outf = text[shift + col]; // Display the corresponding column of the text
}
}
cleardisplay(outf, outk); // Clear the display between shifts to avoid ghosting
}
}
}