Adam Stanić
/
LV1ZAD5
LV1ZAD5 Adam Stanic, Alen Sjenicaku
Revision 0:76af52e75515, committed 2016-03-08
- Comitter:
- 2016US_AdamStanic
- Date:
- Tue Mar 08 00:00:40 2016 +0000
- Commit message:
- LV1ZAD5 Adam Stanic, Alen Sjenicaku
Changed in this revision
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 76af52e75515 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 08 00:00:40 2016 +0000 @@ -0,0 +1,63 @@ +#include "mbed.h" + +DigitalOut crvena(LED1); +DigitalOut zelena(LED2); +DigitalOut plava(LED3); + + + + +int main() +{ + float koeficijent=0.03; + + + float pauza=1; + float rad = 1; + float sekunda = 1; + + bool parno = true; + + int brojac=1; + + while(1) + { + + + + crvena=0; + zelena=1; + plava=1; + wait(rad); + + crvena=1; + zelena=1; + plava=1; + wait(pauza); + + if(parno) + { + rad = rad + koeficijent; + pauza = pauza - koeficijent; + } + else + { + rad = rad - koeficijent; + pauza = pauza + koeficijent; + } + + + brojac++; + + if(brojac==30) + { + if(parno) + parno = false; + else + parno = true; + + brojac=0; + } + } +} + \ No newline at end of file
diff -r 000000000000 -r 76af52e75515 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Mar 08 00:00:40 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb \ No newline at end of file