Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
liammchale
Date:
Sat Aug 01 11:00:03 2020 +0000
Commit message:
labq4

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 7de9a7435bc8 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 01 11:00:03 2020 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+
+DigitalIn fire(p14);
+PwmOut spkr(p26);
+AnalogIn pot1(p19);
+float start = 2000.0;
+float end = 10000.0;
+float step = 100;
+
+int main(){
+    while(1){
+        for(float i = 2000.0;
+        i<10000.0;
+        i+=100){
+            for (float i = start;
+            i<end;
+            i+=step){
+                spkr.period(1.0/i);
+                spkr=0.5;
+                wait(0.1);
+                }
+for (float i = start;
+i<end;
+i+=step){
+            spkr.period(1.0/i);
+            spkr=0.7;
+            wait(0.3);
+        }
+        
+}
+spkr=0.0;
+start = 3000.0;
+while(pot1.read()<0.5){}// put controls the programme
+    }
+}
+            
\ No newline at end of file
diff -r 000000000000 -r 7de9a7435bc8 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Aug 01 11:00:03 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file