Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:5742b01051e5
- Child:
- 1:760c5b759868
diff -r 000000000000 -r 5742b01051e5 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Jul 28 09:44:44 2019 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+DigitalIn fire(p14); // centre pin of joystick.
+PwmOut spkr(p26); // speaker output
+
+int main() {
+ while(1) {
+ for (float i=2000.0; i<10000; i+=100) { // increment i by 200 each loop if the value at teh start of the loo is less than 1000
+ spkr.period(1.0/i);
+ spkr=0.5;
+ wait(0.1);
+ }
+ spkr=0.0;
+ while(!fire) {}
+ }
+}