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
Fork of BoxBrovoEcho_OCt3 by
Diff: main.cpp
- Revision:
- 0:b265ed6faf6c
- Child:
- 1:fa78d980522c
diff -r 000000000000 -r b265ed6faf6c main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Aug 29 17:35:19 2018 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+
+Ticker scheduler1;
+Ticker scheduler2;
+Ticker scheduler3;
+Ticker scheduler4;
+
+DigitalOut THY_S(p5, 0);
+DigitalOut IGBT_G(p6, 0);
+DigitalOut led1(LED1, 0);
+DigitalOut led2(LED2, 0);
+
+
+void task1() {
+ THY_S = !THY_S;
+}
+
+void task2() {
+ IGBT_G = !IGBT_G;
+}
+
+void task3() {
+ led1 = !led1;
+}
+
+void task4() {
+ led2 = !led2;
+}
+
+int main() {
+ THY_S = 0;
+ IGBT_G = 0;
+ led1 = 0;
+ led2 = 0;
+
+ scheduler1.attach(&task1, 0.005); // Four independent tasks
+ scheduler2.attach(&task2, 0.05); //
+ scheduler3.attach(&task3, 0.5); //
+ scheduler4.attach(&task4, 1); //
+
+
+ while(1) {
+
+ }
+}
\ No newline at end of file
