Killian Spain / Mbed 2 deprecated INST8100_Lab04

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
t00221549
Date:
Sun Aug 08 19:42:07 2021 +0000
Commit message:
first commit

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
diff -r 000000000000 -r df543f411aab main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Aug 08 19:42:07 2021 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+DigitalIn fire(p14);
+PwmOut spkr(p26);
+AnalogIn pot1(p19);
+float start=2000;
+float finish=10000;
+float step=200;
+
+int main()
+{
+    while (1) {
+        for (float i=start; i<finish; i+=step) {
+            spkr.period(1.0/i);
+            spkr=0.5;
+            wait(0.1);
+        }
+        spkr=0.0;
+        
+        start += 1000;
+        if (start >= 6000){
+            start = 6000;
+            }
+            
+        
+        while(pot1.read() < 0.5) {} // this uses the pot to control the program
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r df543f411aab mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Aug 08 19:42:07 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file