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.
Dependencies: mbed TTU_CSC1300
Diff: main.cpp
- Revision:
- 0:911c8f66a59d
- Child:
- 1:c9aa78523331
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Mar 23 21:56:15 2021 +0000
@@ -0,0 +1,31 @@
+/*
+ * Lab #:
+ * Lab Title:
+ * Author(s):
+ * Date:
+ * Purpose:
+ */
+
+#include "mbed.h"
+#include "TTU_CSC1300.h"
+
+//FUNCTION PROTOTYPES GO HERE
+
+int main()
+{
+ //this while(TRUE) loop keeps the program running
+ while(TRUE)
+ {
+ //WRITE SOLUTION HERE
+ float f_value = pot.read(); //f_value > 0.0f && f_value < 1.0f
+ f_value = (f_value * 25) + 20;
+ speaker = TRUE; //will turn the speaker on, sending a single square wave
+ wait_ms(250); //delays for 250 ms
+ speaker = FALSE; //will turn the speaker off
+ led0 = TRUE;
+ wait_ms(500);
+ led0 = FALSE;
+ wait_ms(500);
+ wait_ms(f_value);
+ }
+}