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:
- JES
- Date:
- 2014-10-30
- Revision:
- 0:1598a1fa71db
File content as of revision 0:1598a1fa71db:
#include "mbed.h" DigitalOut led1(LED1),led2(LED2),led3(LED3),led4(LED4); Ticker tick; volatile int countUp; void teller() { countUp++; if (countUp >= 100) countUp = 0; } int main() { tick.attach(&teller, 0.0001); while(1) { if (countUp < 25 && countUp >= 0) led1 = 1 ; else led1 = 0; if (countUp < 50) led2 = 1 ; else led2 = 0; if (countUp < 75) led3 = 1 ; else led3 = 0; if (countUp < 95) led4 = 1 ; else led4 = 0; } } /* #include "mbed.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); DigitalOut led4(LED4); Ticker tick1; Ticker tick2; Ticker tick3; Ticker tick4; volatile int lys1, lys2, lys3, lys4; void lyscontroll_1() { lys1=!lys1; } void lyscontroll_2() { lys2=!lys2; } void lyscontroll_3() { lys3=!lys3; } void lyscontroll_4() { lys4=!lys4; } int main() { tick1.attach(&lyscontroll_1, 0.0001*125); tick2.attach(&lyscontroll_2, 0.0001*150); tick3.attach(&lyscontroll_3, 0.0001*170); tick4.attach(&lyscontroll_4, 0.0001*195); while (1) { led1 = lys1; led2 = lys2; led3 = lys3; led4 = lys4; } } */