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.
Diff: main.cpp
- Revision:
- 0:a550aef65fac
- Child:
- 1:0f682b1c98ec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Oct 28 01:54:47 2017 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+
+
+Ticker tk1;
+Ticker tk2;
+DigitalOut output1(LED1); // digital output
+Serial serial(USBTX, USBRX);
+
+
+void task1(void); // task function prototype
+void task2(void); // task function prototype
+
+
+
+//*** main code
+
+void main() {
+ output1=0;
+ tk1.attach(&task1, 0.8);
+ tk2.attach(&task2, 0.6);
+ while(1) {
+ wait_ms(2000);
+ output1=!output1; // toggle output
+ }
+ }
+void task1(void){ // task function
+
+ serial.printf("hola soy task1\n");
+ wait_ms(300);
+
+
+}
+
+void task2(void){ // task function
+
+ serial.printf("hola soy task2\n");
+ wait_ms(300);
+
+}
\ No newline at end of file