tim007 tim007
/
LV8-Grupa6-Tim007-zad3
Armin Klačar Josip Kvesić
Revision 0:3c58a06d8217, committed 2014-05-08
- Comitter:
- tim007
- Date:
- Thu May 08 15:46:47 2014 +0000
- Commit message:
- LV8-PAI-Grupa6-Tim007;
Changed in this revision
--- /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
--- /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); +}
--- /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