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.
Revision 45:f730263c5ce1, committed 2017-12-04
- Comitter:
- kadonotakashi
- Date:
- Mon Dec 04 06:24:51 2017 +0000
- Parent:
- 44:4ebd764e1db9
- Commit message:
- use OS
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Dec 04 03:11:05 2017 +0000
+++ b/main.cpp Mon Dec 04 06:24:51 2017 +0000
@@ -2,11 +2,27 @@
DigitalOut led1(LED1);
-// main() runs in its own thread in the OS
-int main() {
- while (true) {
- led1 = !led1;
- wait(2.5);
+
+void led1_thread(void const *argument)
+{
+ while(true){
+ led1=!led1;
+ Thread::wait(1000);
}
}
+
+//Serial pc(USBTX, USBRX); // tx, rx
+
+// main() runs in its own thread in the OS
+int main()
+{
+ Thread thread(led1_thread);
+
+ while (true) {
+// pc.printf("main thread \r\n");
+ printf("main thread \r\n");
+ Thread::wait(3000);
+ }
+}
+