Colby Adams / Mbed 2 deprecated EduBaseV2_Lab3

Dependencies:   mbed TTU_CSC1300

Files at this revision

API Documentation at this revision

Comitter:
kingcolba
Date:
Fri Apr 09 20:10:04 2021 +0000
Commit message:
Lab3

Changed in this revision

TTU_CSC1300.lib Show annotated file Show diff for this revision Revisions of this file
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 2795fb9c6557 TTU_CSC1300.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TTU_CSC1300.lib	Fri Apr 09 20:10:04 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/jwbruce/code/TTU_CSC1300/#7bb32dea705b
diff -r 000000000000 -r 2795fb9c6557 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 09 20:10:04 2021 +0000
@@ -0,0 +1,38 @@
+/*
+ *     Lab #: 3
+ * Lab Title: Reading and Processing Analog Inputs
+ * Author(s): Colby Adams
+ *      Date: 5 April 2021
+ *   Purpose: Conditional Statements
+ */
+
+#include "mbed.h"
+#include "TTU_CSC1300.h"
+
+//FUNCTION PROTOTYPES GO HERE
+TextLCD lcd(TextLCD::LCD_CURSOR_ON_BLINKING_ON);
+
+int main(){
+    //this while(TRUE) loop keeps the program running
+    while(TRUE){
+     
+        float f_value = pot.read(); //f_value > 0.0f && f_value < 1.0f
+        float timer = (f_value * 25) + 20;
+     
+        if ((sw5 == true && timer > 35) || sw4 == true){
+            if (led0 == false){
+               speaker = true;
+               led0 = true;
+            } else if (led0 == true){
+               led0 = false;
+               speaker = true;
+            }
+        } else {
+            if (speaker == true){
+               speaker = false;
+            } else if (speaker == false){
+                speaker = true;
+            }
+        }
+    }                 
+}
\ No newline at end of file
diff -r 000000000000 -r 2795fb9c6557 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Apr 09 20:10:04 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file