IOT_Lec1_Blink_Led_OS6_

Files at this revision

API Documentation at this revision

Comitter:
cornetlin
Date:
Tue Oct 27 15:59:50 2020 +0000
Commit message:
blink Mbed6.x

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib 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 Oct 27 15:59:50 2020 +0000
@@ -0,0 +1,23 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2019 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include "mbed.h"
+
+
+// Blinking rate in milliseconds
+#define BLINKING_RATE     500ms
+
+
+int main()
+{
+    printf(" MbedOS v %d.%d.%d\r\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
+    // Initialise the digital pin LED1 as an output
+    DigitalOut led(LED1);
+
+    while (true) {
+        led = !led;
+        ThisThread::sleep_for(500ms);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Tue Oct 27 15:59:50 2020 +0000
@@ -0,0 +1,1 @@
+https://github.com/armmbed/mbed-os/#890f0562dc2efb7cf76a5f010b535c2b94bce849