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:e060ec1efa33, committed 2014-10-30
- Comitter:
- JES
- Date:
- Thu Oct 30 14:50:34 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 |
diff -r 000000000000 -r e060ec1efa33 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 30 14:50:34 2014 +0000 @@ -0,0 +1,55 @@ +#include "mbed.h" + +DigitalOut led1(LED1), led2(LED2), led3(LED3), led4(LED4); +Ticker tick1, tick2, tick3, tick4 ; + +volatile int lys1, lys2, lys3, lys4; +Timer timer; + +void lyscontroll_1() +{ + lys1=!lys1; +} +void lyscontroll_2() +{ + lys2=!lys2; +} +void lyscontroll_3() +{ + lys3=!lys3; +} +void lyscontroll_4() +{ + lys4=!lys4; +} +int runOnce =1; +int main() +{ + timer.start (); + tick1.attach(&lyscontroll_1, 1.0/2); + tick2.attach(&lyscontroll_2, 1.0/6.6); + tick3.attach(&lyscontroll_3, 1.0/14); + + + + while (1) { + led1 = lys1; + led2 = lys2; + led3 = lys3; + led4 = lys4; + if (timer.read()>=10 && runOnce == 1){ + tick4.attach(&lyscontroll_4, 1.0/20); + runOnce =0; + } + if (timer.read() >=10) { + tick1.detach(); + if (timer.read() >=20) { + tick2.detach(); + if (timer.read() >=20) { + tick3.detach(); + + } + } + } + } +} \ No newline at end of file
diff -r 000000000000 -r e060ec1efa33 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 30 14:50:34 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89 \ No newline at end of file