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
main.cpp
- Committer:
- Wiegerinck
- Date:
- 2018-03-28
- Revision:
- 7:4f8de47a9641
- Parent:
- 2:b60cb847489c
File content as of revision 7:4f8de47a9641:
#include "mbed.h" DigitalOut myled(LED1); DigitalOut T1(PB_3); DigitalOut T2(PB_4); DigitalOut T3(PB_5); DigitalOut T4(PB_10); int val = 0; int main() { while(1) { while(val <= 50) { myled = 1; // LED is ON T1 = 1; T2 = 0; T3 = 0; T4 = 0; wait(0.01); // 200 ms myled = 0; // LED is OFF T1 = 0; T2 = 1; T3 = 0; T4 = 0; wait(0.01); // 1 sec T1 = 0; T2 = 0; T3 = 1; T4 = 0; wait(0.01); T1 = 0; T2 = 0; T3 = 0; T4 = 1; wait(0.01); val = val + 1; } while(val >= 0) { myled = 1; // LED is ON T1 = 0; T2 = 0; T3 = 1; T4 = 0; wait(0.01); // 200 ms myled = 0; // LED is OFF T1 = 0; T2 = 1; T3 = 0; T4 = 0; wait(0.01); // 1 sec T1 = 1; T2 = 0; T3 = 0; T4 = 0; wait(0.01); T1 = 0; T2 = 0; T3 = 0; T4 = 1; wait(0.01); val = val - 1; } } }