affichage VGA
Dependencies: mbed fastlib vga640x400
main.c
00001 #include "mbed.h" 00002 #include "vga640x400/vga640x400.h" 00003 00004 Serial pc(USBTX, USBRX); // tx, rx 00005 00006 extern unsigned char font_lin[256*16]; 00007 00008 int main() { 00009 font = font_lin; 00010 char phrase[] = "Bonjour, je m'appelle clement, j'habite a Bondoufle et j'aime bricoler. je mange du poulet, du riz et du fromage"; 00011 //char phrase[] = "Bonjour, jean-mich"; 00012 00013 //char bufferPrase1 [] = ""; 00014 int longueurPhrase = 0; //ATTENTION +1 car carractère de fin 00015 00016 longueurPhrase = sizeof(phrase); 00017 00018 pc.printf("AZERTY\n\r"); 00019 pc.printf("%d\n\r", longueurPhrase); 00020 00021 00022 00023 /*for (int i=0 ; i<sizeof(phrase); i ++) 00024 { 00025 bufferPrase1 [i] = phrase[i]; //80 caractères par lignes 00026 pc.printf("%c", bufferPrase1[i]); 00027 }*/ 00028 00029 ////////////Affichage/////////////// 00030 // xor 1 to compensate for character order (10325476 et cetera) 00031 // moved to userspace instead of rendering loop for obvious reasons 00032 for (int i=0; i<400; i++) 00033 text_buffer[i^1] = 0xff; 00034 00035 for (int i=0 ; i<sizeof(phrase); i ++) 00036 text_buffer[(400+i)^1] = phrase[i]; //80 caractères par lignes 00037 00038 00039 init_vga(); 00040 00041 while(1); 00042 }
Generated on Thu Jul 14 2022 09:21:43 by
1.7.2