Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LV1_Grupa4_Tim008_Zadatak4 by
Revision 5:1d29fc39756e, committed 2014-03-03
- Comitter:
- tim008
- Date:
- Mon Mar 03 18:44:33 2014 +0000
- Parent:
- 4:49e8f8e92f9d
- Commit message:
- LV1 - PAI - Grupa 4 - Tim008
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 03 18:18:24 2014 +0000 +++ b/main.cpp Mon Mar 03 18:44:33 2014 +0000 @@ -1,42 +1,38 @@ #include "mbed.h" -DigitalOut boje[3] = {LED1, LED2, LED3}; +DigitalOut myled(LED1); int main() { + double t1 = 0.005, t2 = 0.005; - while(1) - { - boje[1] = 1; - boje[2] = 1; - wait(1); - boje[1] = 0; - boje[2] = 0; - - boje[2] = 1; - wait(1); - boje[2] = 0; + while(1) { - boje[0] = 1; - boje[2] = 1; - wait(1); - boje[0] = 0; - boje[2] = 0; + for(int i = 0; i < 200; i++) { + myled = 0; + wait(t1); + myled = 1; + wait(t2); + t1 += 0.0000245; + t2 -= 0.0000245; + } - boje[0] = 1; - wait(1); - boje[0] = 0; + for(int i = 0; i < 400; i++) { + myled = 0; + wait(t1); + myled = 1; + wait(t2); + t1 -= 0.0000245; + t2 += 0.0000245; + } - boje[0] = 1; - boje[1] = 1; - wait(1); - boje[0] = 0; - boje[1] = 0; - - - boje[1] = 1; - wait(1); - boje[1] = 0; - - - } + for(int i = 0; i < 200; i++) { + myled = 0; + wait(t1); + myled = 1; + wait(t2); + t1 += 0.0000245; + t2 -= 0.0000245; + } + + } }