Armin Klačar Josip Kvesić

Dependencies:   N5110 mbed

Files at this revision

API Documentation at this revision

Comitter:
tim007
Date:
Thu May 08 15:46:47 2014 +0000
Commit message:
LV8-PAI-Grupa6-Tim007;

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 3c58a06d8217 N5110.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/N5110.lib	Thu May 08 15:46:47 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/eencae/code/N5110/#adb79338d40f
diff -r 000000000000 -r 3c58a06d8217 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 08 15:46:47 2014 +0000
@@ -0,0 +1,52 @@
+#include "mbed.h"
+#include "N5110.h"
+N5110 lcd(dp4,dp24,dp23,dp25,dp2,dp6,dp18);
+Serial pc(USBTX, USBRX);
+DigitalOut enable (dp14);
+int x=0;
+int y=0;
+void readwrite()
+{
+    if(!pc.readable()) return;
+    char c = pc.getc();
+    if (c=='1')
+    {
+        lcd.clear();
+        lcd.setXYAddress(x=0,y=0);
+    }
+    else if (c=='2')
+    {
+        ++y;
+        if(y==6) y=0;
+        lcd.setXYAddress(x=0,y);
+    }
+    else if (c=='3')
+    {
+        x-=6;
+        if(x<0) {y--; x = 77;if(y<0) y=0; }
+        lcd.setXYAddress(x,y);
+        lcd.printChar(' ');
+        lcd.setXYAddress(x,y);
+    }
+    else if(c >= 32 && c < 126)
+    {
+        if(x>77)
+        {
+            x=0;
+            y++;
+            if (y==6) y=0;
+            lcd.setXYAddress(x,y);
+        }
+        lcd.printChar(c);
+        x+=6;
+    }
+
+}
+int main()
+{
+    enable = 1;
+    lcd.init();
+    lcd.setXYAddress(x,y);
+    pc.attach(readwrite);
+    while(1);
+}
diff -r 000000000000 -r 3c58a06d8217 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 08 15:46:47 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776
\ No newline at end of file