Tarik Demirović Aida Pločo

Dependencies:   N5110 mbed

Revision:
0:3c24a8a80614
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 19 07:57:55 2014 +0000
@@ -0,0 +1,64 @@
+#include "mbed.h"
+#include "N5110.h"
+#include "Reket.h"
+
+
+Reket rLijevi (1, 2, 5, 12);
+Reket rDesni (81, 82, 10, 17);
+
+char skor1[1];
+char skor2[1];
+
+N5110 display(dp4,dp24,dp23,dp25,dp2,dp6,dp18);
+DigitalOut enable (dp14);
+
+AnalogIn P1(dp9);
+AnalogIn P2(dp10);
+
+void cifre(int cifra)
+{
+    if(cifra == 0)
+    {
+        for(int i = 0; i < 4; i++)
+            display.setPixel(31 + i, 1);
+            
+        for(int i = 0; i < 5; i++)
+            display.setPixel(34, 1 + i);
+            
+        for(int i = 0; i < 4; i++)
+            display.setPixel(31 + i, 6);
+        
+        for(int i = 0; i <= 5; i++)
+            display.setPixel(30, 1 + i);
+    }
+            
+   display.refresh(); 
+}
+
+int main() {
+    skor1[0] = '4';
+    skor2[0] = '0';
+    enable = 1;
+    display.init();
+    display.setXYAddress(0, 0);
+    
+    while(1)
+    {
+        for(int i = 0; i < 47; i++)
+        display.setPixel(41, i);
+        
+        display.refresh();
+        
+        rLijevi.brisiReket(display);
+        rLijevi.osvjeziPoziciju(P1);
+        rLijevi.crtajReket(display);
+        
+        rDesni.brisiReket(display);
+        rDesni.osvjeziPoziciju(P2);
+        rDesni.crtajReket(display);
+        
+        cifre(0);
+        
+        wait(0.05);
+    }
+}