Ovo je vježba 1.
Dependencies: mbed
T_TOTALndT_FLASH.cpp
- Committer:
- JosipLupinski
- Date:
- 2016-10-19
- Revision:
- 1:77097e35c855
File content as of revision 1:77097e35c855:
#include "mbed.h" DigitalOut myled1(LED1); DigitalOut myled2(LED2); const float T_TOTAL=10; const float T_FLASH=0.2; int main() { float T_CALC; T_CALC = T_TOTAL / (2 * T_FLASH); while(true){ for(float i=1; i<=T_CALC;i++){ myled1=1; wait(T_FLASH); myled1=0; wait(T_FLASH); } for(float j=1; j<=T_CALC;j++){ myled2=1; wait(T_FLASH); myled2=0; wait(T_FLASH); } } }