Goro Faruk Kičin Adnan

Dependencies:   N5110 mbed

Files at this revision

API Documentation at this revision

Comitter:
tim003
Date:
Mon Apr 28 15:57:53 2014 +0000
Commit message:
LV7-PAI-Grupa3-Zadatak1

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
diff -r 000000000000 -r f49d98312c14 N5110.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/N5110.lib	Mon Apr 28 15:57:53 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/eencae/code/N5110/#adb79338d40f
diff -r 000000000000 -r f49d98312c14 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 28 15:57:53 2014 +0000
@@ -0,0 +1,71 @@
+#include "mbed.h"
+#include "N5110.h"
+ 
+//Deklaracija LCD objekta
+//N5110 lcd(VCC,SCE,RST,D/C,MOSI,SCLK,LED)
+N5110 lcd(dp4,dp24,dp23,dp25,dp2,dp6,dp18);
+ //Analogni ulazi sa dzojstika
+AnalogIn    VRx(dp11);
+AnalogIn    VRy(dp10);
+//Taster sa dzojstika
+DigitalIn   SW(dp9);
+//Digitalni izlaz za deaktivaciju LED buffera
+DigitalOut enable(dp14);
+DigitalIn taster1(dp1);
+ 
+bool tasterJedan(){
+    bool udaren = false;
+    int i=0;
+    while(taster1) i++;
+    if(i>5000) udaren=true;
+    return udaren;
+}
+
+struct koordinata {
+    int x,y;
+   
+     koordinata() : x(0), y(0) {}
+    
+};
+
+void metniKurzor(int x, int y, koordinata* K, int velicina) {
+    if(x<83 && y<47 && x>0 && y>0){
+    lcd.clear();
+    for(int i(0); i<velicina; i++) {
+    lcd.setXYAddress(0,0);
+    lcd.setPixel(K->x,K->y);
+    }
+    lcd.setXYAddress(0,0);
+    lcd.setPixel(x,y);
+    lcd.setPixel(x+1,y);
+    lcd.setPixel(x-1,y);
+    lcd.setPixel(x,y+1);
+    lcd.setPixel(x,y-1);
+    lcd.refresh();
+    }
+}
+
+koordinata tacke[100]; 
+void Taster(int x, int y, int brojac) {
+    int i=brojac;
+    tacke[i].x=x;
+    tacke[i].y=y;
+}
+
+int main()
+{
+    lcd.setXYAddress(0,0);
+    lcd.init ();
+    metniKurzor(42,24,tacke,100);
+ 
+    while (1) {
+    int i=0;
+    int x = VRx*83, y = VRy*47;
+    if(tasterJedan()){ Taster(x,y,i); i++; }
+        metniKurzor(x, y, tacke, 100);
+        
+    
+}
+
+}
+       
\ No newline at end of file
diff -r 000000000000 -r f49d98312c14 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Apr 28 15:57:53 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file