tim003 tim003
/
LV8_Grupa1_Tim003_Zadatak3
Tarik Demirović Aida Pločo
Revision 0:dd95051d5d71, committed 2014-05-12
- Comitter:
- tim003
- Date:
- Mon May 12 07:18:24 2014 +0000
- Commit message:
- LV8-PAI-Grupa1-Tim003-Zadatak3
Changed in this revision
diff -r 000000000000 -r dd95051d5d71 N5110.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/N5110.lib Mon May 12 07:18:24 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/eencae/code/N5110/#adb79338d40f
diff -r 000000000000 -r dd95051d5d71 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 12 07:18:24 2014 +0000 @@ -0,0 +1,62 @@ +#include "mbed.h" +#include "N5110.h" +#include <string> + +Serial pc(USBTX, USBRX); +N5110 lcd(dp4,dp24,dp23,dp25,dp2,dp6,dp18); + +DigitalOut enable (dp14); + +int x = 0; +int y = 0; + +void ocitaj() +{ + char buf[50]; + buf[0] = pc.getc(); + + if(buf[0] == '1') + { + y++; + if(y > 5) y = 0; + x = 0; + } + + else if(buf[0] == '2') + { + lcd.clear(); + x = 0; + y = 0; + } + + else if(buf[0] == '3') + { + x -= 5; + if(x < 0 and y > 0){ + x = 82; + y--; + } + + lcd.printString(" ", x, y); + } + + else + { + lcd.printString(buf, x, y); + x += 5; + if(x > 83) + { + x = 0; + y++; + if( y > 5) y = 0; + } + } +} + +int main() { + enable = 1; + lcd.init(); + lcd.setXYAddress(0, 0); + pc.attach(&ocitaj); + while(1) {} +}
diff -r 000000000000 -r dd95051d5d71 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon May 12 07:18:24 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776 \ No newline at end of file