Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:f9065ea26a3d
diff -r 000000000000 -r f9065ea26a3d main.cpp
--- /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