Øving 4.4

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Smashftw
Date:
Wed Sep 20 13:13:31 2017 +0000
Commit message:
?ving 4.4

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 60ad536c1c05 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 20 13:13:31 2017 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+ 
+DigitalOut myLed1(LED1);
+DigitalOut myLed2(LED2);
+DigitalOut myLed3(LED3);
+DigitalOut myLed4(LED4);
+Ticker tick1;
+Ticker tick2;
+Ticker tick3;
+Ticker tick4;
+volatile int xx, yy, zz, ee;
+ 
+void x()
+{
+    xx = !xx;
+}
+void y()
+{
+    yy = !yy;
+}
+void z()
+{
+    zz = !zz;
+}
+void e()
+{
+    ee = !ee;
+}
+int main()
+{
+    tick1.attach(&x,1);
+    tick2.attach(&y, 0.3);
+    tick3.attach(&z, 0.14);
+    tick4.attach(&e, 0.1);
+    while(1) {
+        myLed1 = xx;
+        myLed2 = yy;
+        myLed3 = zz;
+        myLed4 = ee;
+ 
+    }
+}
+ 
+            
diff -r 000000000000 -r 60ad536c1c05 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 20 13:13:31 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/675da3299148
\ No newline at end of file