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
Revision 0:1598a1fa71db, committed 2014-10-30
- Comitter:
- JES
- Date:
- Thu Oct 30 14:50:11 2014 +0000
- Commit message:
- .
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 30 14:50:11 2014 +0000 @@ -0,0 +1,79 @@ +#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; + + } +} +*/ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 30 14:50:11 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1 \ No newline at end of file