Ian Shelton / Mbed 2 deprecated Lab7

Dependencies:   mbed TTU_CSC1300

Files at this revision

API Documentation at this revision

Comitter:
iashelton
Date:
Tue Apr 06 04:15:41 2021 +0000
Commit message:
Lab 7 ; potentiometer

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TTU_CSC1300.lib	Tue Apr 06 04:15:41 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/jwbruce/code/TTU_CSC1300/#7bb32dea705b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Apr 06 04:15:41 2021 +0000
@@ -0,0 +1,34 @@
+/*
+ *     Lab #:
+ * Lab Title:
+ * Author(s):
+ *      Date:
+ *   Purpose:
+ */
+ 
+#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)
+    {
+        //WRITE SOLUTION HERE
+        float f_value(0);
+        f_value = pot.read(); 
+        f_value=f_value*20;
+        f_value=f_value+20;
+        speaker = TRUE;  //will turn the speaker on, sending a single square wave
+        led0 = TRUE;
+        wait_ms(10);    //delays for 250 ms
+        speaker = FALSE; //will turn the speaker off
+        wait_ms(f_value);
+        
+        
+    }
+}
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Apr 06 04:15:41 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file