Teste Buzzer (1)

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
afm76
Date:
Mon Mar 30 03:03:09 2020 +0000
Commit message:
Teste Buzzer (1)

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Mar 30 03:03:09 2020 +0000
@@ -0,0 +1,58 @@
+#include "mbed.h"
+int i;
+int x;
+
+DigitalOut LED(PA_5);
+
+
+int main() {
+    x = 1;
+    
+    while(x == 1) {
+//Do
+        for (i=1; i<500; i++){
+        LED = 1; // LED is ON
+        wait(0.0019 ); // 250 msec
+        LED = 0; // LED is OFF
+        wait(0.0019); // 0.5 sec
+        }
+  //      wait(1);
+        LED = 0;
+//Re
+        for (i=1; i<500; i++){
+        LED = 1; // LED is ON
+        wait(0.0017 ); // 250 msec
+        LED = 0; // LED is OFF
+        wait(0.0017); // 0.5 sec
+        }
+  //      wait(1);
+//Mi
+        for (i=1; i<500; i++){
+        LED = 1; // LED is ON
+        wait(0.0015 ); // 250 msec
+        LED = 0; // LED is OFF
+        wait(0.0015); // 0.5 sec
+        }
+  //      wait(1);
+  
+//Fa
+        for (i=1; i<500; i++){
+        LED = 1; // LED is ON
+        wait(0.0014 ); // 250 msec
+        LED = 0; // LED is OFF
+        wait(0.0014); // 0.5 sec
+        }
+//Sol
+        for (i=1; i<500; i++){
+        LED = 1; // LED is ON
+        wait(0.0012 ); // 250 msec
+        LED = 0; // LED is OFF
+        wait(0.0012); // 0.5 sec
+        }
+        
+        LED = 0;
+        LED = 0;
+        x = 0;
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 30 03:03:09 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file