You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1009 B
41 lines
1009 B
2 years ago
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
struct X {
|
||
|
uint8_t data[4];
|
||
|
};
|
||
|
|
||
|
const struct X font[] = {
|
||
|
{{0x0e, 0x11, 0x11, 0x0e}}, // 0
|
||
|
{{0x04, 0x12, 0x1f, 0x10}}, // 1
|
||
|
{{0x12, 0x19, 0x15, 0x12}}, // 2
|
||
|
{{0x0a, 0x11, 0x15, 0x0a}}, // 3
|
||
|
{{0x07, 0x04, 0x1e, 0x04}}, // 4
|
||
|
{{0x17, 0x15, 0x15, 0x09}}, // 5
|
||
|
{{0x0e, 0x15, 0x15, 0x09}}, // 6
|
||
|
{{0x11, 0x09, 0x05, 0x03}}, // 7
|
||
|
{{0x0a, 0x15, 0x15, 0x0a}}, // 8
|
||
|
{{0x12, 0x15, 0x15, 0x0a}}, // 9
|
||
|
{{0x00, 0x00, 0x00, 0x00}}, // ' '
|
||
|
};
|
||
|
|
||
|
void main() {
|
||
|
printf("const char* symbols[] = {\n");
|
||
|
for(int c = 0; c < 11; c++) {
|
||
|
printf(" // %d \"%c\"\n", c+'0', c+'0');
|
||
|
for(int j=0;j<5;j++){
|
||
|
printf(" \"");
|
||
|
for(int k=0;k<4;k++){
|
||
|
if (font[c].data[k]& (1<<j)) {
|
||
|
printf("#");
|
||
|
} else {
|
||
|
printf(" ");
|
||
|
}
|
||
|
}
|
||
|
printf("\",\n");
|
||
|
}
|
||
|
}
|
||
|
printf("};\n");
|
||
|
}
|