Wade Samples / Mbed 2 deprecated Lab4

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
wadesamples
Date:
Wed Apr 21 02:57:18 2021 +0000
Commit message:
Works on conditional loops;

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	Wed Apr 21 02:57:18 2021 +0000
@@ -0,0 +1,35 @@
+/*
+ *     Lab #: 4
+ * Lab Title: Counting in binary with loops
+ * Author(s): Wade Samples
+ *      Date: 04/14/2021
+ *   Purpose: Conditional loops
+ */
+
+#include "mbed.h"
+#include "TTU_CSC1300.h"
+
+BusOut all_leds (LED0_PIN, LED1_PIN, LED2_PIN);
+
+int main()
+{
+    //this while(TRUE) loop keeps the program running
+    while(TRUE)
+    {
+        while (sw5 == true)
+        {
+            all_leds = 7;
+            wait_ms(10);
+            all_leds = 0;
+        }
+        
+        do{
+            int i;
+            for (i = 0; i <= 7; i++)
+            {
+                all_leds = i;
+                wait_ms(300);
+            }
+            }while (sw5 == false);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 21 02:57:18 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file