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.
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);
}
}
}