29.9.2020

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
shogu
Date:
Tue Sep 29 15:52:57 2020 +0000
Commit message:
prvi;

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 2e7c943c07a9 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 29 15:52:57 2020 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+//DigitalOut myled(LED1);
+
+class MyLed {
+    public:
+        MyLed(PinName led) : _led(led) {
+            _led = 1;
+        }
+        
+        void ledOn(void) {
+            _led = 1;
+            wait_ms(500);
+        }
+        
+        MyLed() {};
+    
+    private:
+        DigitalOut _led;
+    };
+    
+MyLed myLed(LED1);
+MyLed myLed2(LED2);
+
+int main() {
+    while(1) {
+        myLed.ledOn();
+        myLed.ledOff();
+        myLed2.ledOn();
+        myLed2.ledOff();
+    }
+}
diff -r 000000000000 -r 2e7c943c07a9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 29 15:52:57 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file