tim010 tim010
/
LV7_PAI_Grupa5_tim10_Zadatak1
Amer Ratkovic Amela Spica
Revision 0:882d5004b8b7, committed 2014-04-24
- Comitter:
- tim010
- Date:
- Thu Apr 24 14:05:09 2014 +0000
- Commit message:
- Amer Ratkovic; Amela ?pica
Changed in this revision
diff -r 000000000000 -r 882d5004b8b7 N5110.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/N5110.lib Thu Apr 24 14:05:09 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/eencae/code/N5110/#adb79338d40f
diff -r 000000000000 -r 882d5004b8b7 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 24 14:05:09 2014 +0000 @@ -0,0 +1,105 @@ +#include "mbed.h" +#include "N5110.h" + + //hello prepisivacu + +AnalogIn VRx(dp11); +AnalogIn VRy(dp10); +//Taster sa dzojstika +DigitalIn SW(dp9); + Ticker idemo; + +//Deklaracija LCD objekta +//N5110 lcd(VCC,SCE,RST,D/C,MOSI,SCLK,LED) +N5110 lcd(dp4,dp24,dp23,dp25,dp2,dp6,dp18); + +//Digitalni izlaz za deaktivaciju LED buffera +DigitalOut enable(dp14); + + void krugic(int x,int y) + {int i; + //ovo ne radi iz nekog razloga i iz kojeg smo izgubili 20 min tako da ne prepisujte ovaj dio sa stringom, ostalo radi :( + //sretno + lcd.clear(); + lcd.setXYAddress(0,0); + lcd.printString("sada",0,0); +//ovo dolje je ok +lcd.refresh(); +lcd.setXYAddress(0,0); + lcd.setPixel(x,y); + for(i=0;i<5;i++) + { + lcd.setPixel(x-2+i,y); + } + for(i=0;i<5;i++) + { + lcd.setPixel(x,y-2+i); + } + lcd.setPixel(x+1,y+1); + lcd.setPixel(x-1,y-1); + lcd.setPixel(x+1,y-1); + lcd.setPixel(x-1,y+1); + lcd.refresh(); + + +} + + +int main() +{ + enable=1; + + // inicijalizacija displeja + lcd.init(); + lcd.setXYAddress(0,0); + lcd.refresh(); + + int x=42,y=23; + krugic(x,y); + // prikaz stringa + //lcd.printString("Mi volimo PAI!",0,0); + + + while(1) + { + + + + //lcd.refresh(); + if (VRx<1.0/3.0) + { + x=x-3; + krugic(x,y); + } + else if (VRx<2.0/3.0) + { + krugic(x,y); + } + else + {x=x+3; + krugic(x,y); } + wait(0.05); + + if (VRy<1.0/3.0) + { + y=y-3; + krugic(x,y); + + } + else if (VRy<2.0/3.0) + { + krugic(x,y); + + } + else + { + y=y+3; + krugic(x,y); + } + wait(0.05); + } + //ovdje trebate staviti u interupt i radit ce, nismo imali vremena + if (SW==1) + wait(5); + +} \ No newline at end of file
diff -r 000000000000 -r 882d5004b8b7 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 24 14:05:09 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e \ No newline at end of file