Ilvana Brankovic Emina Muharemovic

Dependencies:   N5110 mbed

Files at this revision

API Documentation at this revision

Comitter:
tim008
Date:
Thu May 08 14:07:03 2014 +0000
Commit message:
lv8_Grupa5_Tim008_zad3

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	Thu May 08 14:07:03 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	Thu May 08 14:07:03 2014 +0000
@@ -0,0 +1,89 @@
+#include "mbed.h"
+#include "N5110.h"
+
+N5110 lcd(dp4,dp24,dp23,dp25,dp2,dp6,dp18);
+
+Serial pc( USBTX,USBRX);
+
+
+#define delete '#'
+#define backspace '*'
+#define enter '&'
+
+int x=0;
+int y=0;
+
+
+char unesen;
+
+int main() {
+    lcd.init();
+    lcd.setXYAddress(0,0);
+    while(1) {
+       
+       unesen=pc.getc();
+       if(unesen=='#')
+       {
+           lcd.clear();
+           lcd.refresh();
+           lcd.setXYAddress(0,0);
+           x=0;
+           y=0;
+        }
+        else if(unesen=='&')
+        {
+            if(x==83)
+            {
+                x=0;
+            }
+            y=y+1;         // ili je y+1
+            
+            if(y==48)
+            {
+                y=0;
+            }
+            lcd.setXYAddress(0,y);
+            
+        }
+        else if(unesen=='*')
+        {
+            if(x>6)
+            {
+            for(int i=y-1;i<y;i++)
+            {
+                for(int j=x-6;j<x;j++)
+                {
+                lcd.clearPixel(j,i);
+                }
+            }
+            x=x-6;
+            lcd.setXYAddress(x,y);
+            }
+            else
+            {
+                
+            }
+        
+            
+            
+        }
+        else
+        {
+            lcd.printChar(unesen);
+            x=x+6;
+            if(x==83)
+            {
+                x=0;
+                y=y+1;
+            }
+            //adresa da li se kod printcahr stalno mijenja
+           // da li sam vidi imal mjesta da upise taj svoj char
+        }
+        }
+        
+            
+            
+       
+       
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 08 14:07:03 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776
\ No newline at end of file