include <stdio.h>
#include <string.h>
#include <unistd.h> // For sleep function
// Example 8x8 font array for demonstration
// Each byte represents one column of an 8x8 grid for a character
const uint8_t font[128][8] = {
['G'] = {0x3C, 0x42, 0x81, 0x81, 0x91, 0x92, 0x62, 0x00},
['o'] = {0x00, 0x00, 0x7C, 0x82, 0x82, 0x82, 0x7C, 0x00},
['v'] = {0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x00},
['e'] = {0x00, 0x00, 0x7C, 0x82, 0xFE, 0x80, 0x7C, 0x00},
['r'] = {0x00, 0x00, 0x9C, 0xA2, 0xA0, 0xE0, 0x00, 0x00},
['n'] = {0x00, 0x00, 0xDC, 0xA2, 0xA2, 0xA2, 0xA2, 0x00},
['m'] = {0x00, 0x00, 0xC6, 0xAA, 0xAA, 0xAA, 0xAA, 0x00},
['P'] = {0x00, 0x00, 0xFC, 0x82, 0xFC, 0x80, 0x80, 0x00},
['l'] = {0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00},
['y'] = {0x00, 0x00, 0xC6, 0xC6, 0x7C, 0x0C, 0xF8, 0x00},
['t'] = {0x20, 0x20, 0xF8, 0x20, 0x20, 0x22, 0x1C, 0x00},
['e'] = {0x00, 0x00, 0x7C, 0x82, 0xFE, 0x80, 0x7C, 0x00},
['c'] = {0x00, 0x00, 0x3C, 0x42, 0x80, 0x42, 0x3C, 0x00},
['K'] = {0x00, 0x00, 0x84, 0x88, 0xB0, 0xC8, 0x84, 0x00},
['h'] = {0x00, 0x00, 0xC0, 0xA0, 0xA0, 0xA0, 0xA0, 0x00},
['a'] = {0x00, 0x00, 0x78, 0x04, 0x7C, 0x84, 0x7C, 0x00},
['m'] = {0x00, 0x00, 0xC6, 0xAA, 0xAA, 0xAA, 0xAA, 0x00},
['g'] = {0x00, 0x00, 0x7C, 0x82, 0x7C, 0x02, 0x7C, 0x00},
[' '] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
};
// Function to scroll text
void scrollText(const char *text) {
size_t textLen = strlen(text);
for (size_t pos = 0; pos < textLen; pos++) {
for (int col = 0; col < 8; col++) {
// Print each column of the current character
uint8_t column = font[(int)text[pos]][col];
for (int row = 0; row < 8; row++) {
// Print dot or space based on the bit value
if (column & (1 << row))
printf("●");
else
printf(" ");
}
printf("\n");
}
printf("\n");
sleep(1); // Pause for 1 second between characters
}
}
int main() {
const char *text = "Government Polytechnic Khamgaon";
scrollText(text);
return 0;
}