tim007 tim007
/
LV1_G1_Tim007_Zad3
Enil Pajić Aida Pločo
Diff: main.cpp
- Revision:
- 0:6095153f7e38
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 03 08:00:05 2014 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +DigitalOut L1(LED1); +DigitalOut L2(LED2); +DigitalOut L3(LED3); + +int main() { + double x = 0; + while(1) { + L3 = L2 = 1; + L1 = 0; + wait(1.5 - x); + L1 = 1; + L2 = 0; + wait(1.5 - x); + L2 = 1; + L3 = 0; + wait(1.5 - x); + if (x <= 1.5) + x += 0.2; + else x = 0; + } +}