Mech Lab / Mbed 2 deprecated ME21001_Lab02_Exercise_06

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
davey
Date:
Sat Sep 23 17:51:37 2017 +0000
Commit message:
ex6

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	Sat Sep 23 17:51:37 2017 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+DigitalOut speaker(p26); // use onboard loudspeaker #1
+
+
+int main() {
+
+    
+    while(1) {          //starts indefinite loop
+        speaker = 1;    //turns on loudspeaker
+        wait(0.001);    //for frequency 500Hz
+        speaker = 0;    //turns off loudspeaker
+        wait(0.001);    //for frequency 500Hz
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Sep 23 17:51:37 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/675da3299148
\ No newline at end of file