Преглед на файлове

Added formulas for the writeGraphToMatrix method. Not yet correctly implemented. Axis are create, graph does not yet show up. The "Weerstation" class needs code to call this method when the red button is pressed to make testing easier

Kenneth van Ewijk преди 11 години
родител
ревизия
94cab3188e
променени са 1 файла, в които са добавени 10 реда и са изтрити 12 реда
  1. 10 12
      GUIboard.java

+ 10 - 12
GUIboard.java

@@ -153,18 +153,16 @@ public class GUIboard {
         IO.init();
         clearBottom();
         createAxis(min,max);
-   
-        
-        /*
-        int x,y; 
-        for(x = 0; x < 128; x++ ) 
-        { 
-            y = (int) (Math.sin(x)*2f) + 10;
-            y = 31-y;
-            IO.writeShort(0x42, 1 << 12 | x << 5 | y); 
-            IO.delay(10); 
-        } 
-        */
+        
+        int x,y;
+        double getal;
+        for(int i=0;i<1440;i++)
+        {
+            getal = msList.get(i);
+            x = ((i/1439)*127);
+            y = (int) ((getal - min)/(max-min))*31;
+            IO.writeShort(0x42, 1 << 12 | x << 5 | y );
+        }
     }
     
     //Private functions