tomasz_gurajek

Dependencies:   mbed

Revision:
0:af952e7827ac
diff -r 000000000000 -r af952e7827ac main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 01 12:01:24 2020 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+DigitalIn fire(p14);
+PwmOut spkr(p26);
+AnalogIn pot1(p19);
+float start = 2000.0,end =10000.0,step = 100.0;
+int main()
+{
+ while (1) {
+ for (float i=2000.0; i<10000.0; i+=100) {
+ spkr.period(1.0/i);
+ spkr=0.5;
+ wait(0.1);                  //wait time
+ }                           //end of the loop
+ spkr=0.0;
+ start = 3000.0;             // start 1st sound
+ end = 5000.0;               // end 1st sound
+ while(pot1.read() < 0.5) {} // this uses the pot to control the program
+ }
+}