affichage VGA

Dependencies:   mbed fastlib vga640x400

Files at this revision

API Documentation at this revision

Comitter:
clementlignie
Date:
Wed Jun 12 08:19:57 2019 +0000
Parent:
0:043bbfc55ea1
Commit message:
affichage VGA

Changed in this revision

main.c Show annotated file Show diff for this revision Revisions of this file
diff -r 043bbfc55ea1 -r 8229db8e7d08 main.c
--- a/main.c	Sun Jul 03 18:22:30 2011 +0000
+++ b/main.c	Wed Jun 12 08:19:57 2019 +0000
@@ -1,14 +1,40 @@
+#include "mbed.h"              
 #include "vga640x400/vga640x400.h"
 
+Serial pc(USBTX, USBRX); // tx, rx
+
 extern unsigned char font_lin[256*16];
 
-int main(int argc, char **argv) {
+int main() {
     font = font_lin;
+    char phrase[] = "Bonjour, je m'appelle clement, j'habite a Bondoufle et j'aime bricoler. je mange du poulet, du riz et du fromage";
+    //char phrase[] = "Bonjour, jean-mich";
 
+    //char bufferPrase1 [] = "";
+    int longueurPhrase = 0; //ATTENTION +1 car carractère de fin
+    
+    longueurPhrase = sizeof(phrase);
+    
+    pc.printf("AZERTY\n\r");
+    pc.printf("%d\n\r", longueurPhrase);
+
+    
+
+    /*for (int i=0 ; i<sizeof(phrase); i ++)
+    {
+        bufferPrase1 [i] = phrase[i]; //80 caractères par lignes
+        pc.printf("%c", bufferPrase1[i]);
+    }*/
+ 
+    ////////////Affichage///////////////
     // xor 1 to compensate for character order (10325476 et cetera)
     // moved to userspace instead of rendering loop for obvious reasons
-    for (int i=0; i<2000; i++)
-        text_buffer[i^1] = i & 0xff;
+    for (int i=0; i<400; i++)
+        text_buffer[i^1] = 0xff;
+     
+    for (int i=0 ; i<sizeof(phrase); i ++)
+        text_buffer[(400+i)^1] = phrase[i]; //80 caractères par lignes
+   
 
     init_vga();