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
--- /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();
+    }
+}
--- /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