Muhamed Mujic Gazetic Elma

Dependencies:   N5110 mbed

Files at this revision

API Documentation at this revision

Comitter:
tim003
Date:
Mon Apr 28 18:19:52 2014 +0000
Child:
1:1b31b4833884
Commit message:
LV7_PAI_grupa4_tim003

Changed in this revision

N5110.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/N5110.lib	Mon Apr 28 18:19:52 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/eencae/code/N5110/#adb79338d40f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 28 18:19:52 2014 +0000
@@ -0,0 +1,90 @@
+#include "mbed.h"
+ 
+#include "N5110.h"
+ 
+ 
+//Analogni ulazi sa dzojstika
+AnalogIn    VRx(dp11);
+AnalogIn    VRy(dp10);
+//Taster sa dzojstika
+DigitalIn   SW(dp9);
+int x, y;
+InterruptIn taster(dp1);
+
+ 
+  //    VCC,SCE,RST,D/C,MOSI,SCLK,LED
+N5110 lcd(dp4,dp24,dp23,dp25,dp2,dp6,dp18);
+
+ 
+//Digitalni izlaz za aktivaciju LED buffera
+DigitalOut enable(dp14);
+////LED prikaz
+//BusOut  prikazX(dp28,dp6,dp5);
+//BusOut  prikazY(dp27,dp26,dp25);
+//DigitalOut  prikazSW(dp23);
+// 
+
+Timer timer;
+int brojac=0;
+
+int x1,y1;
+
+void funk()
+{
+    if(timer.read_ms() < 1000 && timer.read_ms() > 200)
+    {
+            
+                 
+            lcd.clear();
+            lcd.refresh();
+            timer.reset();
+            
+    }
+    else if(timer.read_ms() >= 1000)
+    {
+           
+            
+            x = VRx * 83;
+            y = VRy * 47;
+            lcd.setPixel(x,y);
+            lcd.refresh();
+            timer.reset();
+     
+    }
+    
+    
+    
+    
+}
+
+
+int main()
+{
+    //aktivacija LED dioda
+//  
+    //Aktivacija pull-up otpornika
+    SW.mode(PullUp);
+    lcd.init();
+   
+    timer.start();
+    taster.rise(&funk);
+    int temp = 0;
+ 
+    while(1) {
+     temp = 0;
+     x1 = VRx * 83;
+     y1 = VRy * 47;
+     if(lcd.getPixel(x1,y1) != '0')
+     {
+         temp = 1;
+     }    
+     lcd.setPixel(x1,y1);
+     lcd.refresh();
+     wait_ms(100);
+     if(temp == 1){
+        lcd.clearPixel(x1,y1);
+        lcd.refresh(); 
+     }
+     
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Apr 28 18:19:52 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file