it works!

Dependencies:   SDFileSystem2 mbed

Fork of manworm_tv_raster by Bayley Wang

Revision:
11:537cde55b27f
Parent:
10:1163fb31b0a7
Child:
12:e99cc1e9d928
--- a/main.cpp	Sat Mar 10 06:26:01 2018 +0000
+++ b/main.cpp	Thu May 03 23:38:46 2018 +0000
@@ -33,6 +33,8 @@
 #define MIN(a,b) (((a)<(b))?(a):(b))
 #define MAX(a,b) (((a)>(b))?(a):(b))
 
+#define N_COLOR 16
+
 uint8_t char_col = 0;  // current column counter
 uint8_t char_row = 0;  // current row counter
 uint8_t text_buffer_counter = 0; // current index in text buffer counter
@@ -40,6 +42,9 @@
 
 char text_buffer[TX*TY]; // input text buffer for lisp
 
+AnalogIn joy1(A0);
+AnalogIn joy2(A1);
+
 uint8_t want_gfx = 0;
 uint8_t vsync = 0;
 
@@ -663,6 +668,7 @@
     draw_vincent_string(">");
     // main loop
     want_gfx = 1;
+
     for(;;) 
     {
         if(want_lisp) 
@@ -685,7 +691,9 @@
                 gfx_is_init = 1;
             }   
             clr();
-            new_frame(most_recent_char);
+            float j2 = joy1.read() - .5f;;
+            float j1 = joy2.read() - .5f;
+            new_frame(j1,j2);
             draw_line(X0, Y0, X0 + XL, Y0);
             draw_line(X0+XL,Y0,X0+XL,Y0+YL);
             draw_line(X0, Y0+YL, X0 +XL, Y0+YL);
@@ -693,9 +701,22 @@
             most_recent_char = '0';
             //spin_for_a_while(400);
             
-
+            
+            
+//            if(color)
+//            {
+//            for(int i = 0; i <  XL; i++)
+//                draw_line(X0+i,Y0,X0+i,Y0+YL);
+//            color = 0;
+//                }
+//                else
+//                color = 1;
+            
+            //color = !color;
             //draw_gfx_line(-0.01,-0.01,0.01,0.01);
-
+            char joy_string[20];
+            sprintf(joy_string,"1: %.2f 2: %.2f",joy1.read(),joy2.read());
+            //set_status_string(joy_string);
             set_status_string(get_gfx_stat());
             vsync = 0;
             //swap_buffers();