Oliver Ainhirn
/
81_Thread_02
version2
Revision 1:f17f1b284f68, committed 2019-03-14
- Comitter:
- corsa1600
- Date:
- Thu Mar 14 18:32:08 2019 +0000
- Parent:
- 0:300fb6f45ac9
- Commit message:
- version2
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 300fb6f45ac9 -r f17f1b284f68 main.cpp --- a/main.cpp Thu Mar 14 17:58:43 2019 +0000 +++ b/main.cpp Thu Mar 14 18:32:08 2019 +0000 @@ -4,18 +4,29 @@ DigitalOut led2(LED2); Thread thread; -void led2_thread() { +void led2_thread() +{ + double x, y =1.99, z=0.99; while (true) { led2 = !led2; - wait(1); + wait(0.5); + + for (int j=0; j<100; j++) + for (int i=0; i<100000; i++) + x = y*z+x; + } } int main() { thread.start(led2_thread); - + double x, y=1.99, z=0.99; while (true) { led1 = !led1; - wait(0.5); + wait(0.25); + for (int j=0; j<200; j++) + for (int i=0; i<100000; i++) + x = y*z+x; + } } \ No newline at end of file