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.
Dependencies: C027 LM75B MMA7660 mbed
Revision 1:ac55ff7b1a7d, committed 2014-02-03
- Comitter:
- sam_grove
- Date:
- Mon Feb 03 05:00:28 2014 +0000
- Parent:
- 0:4ea8268e9d66
- Child:
- 2:c9e55bcfce9c
- Commit message:
- Initial commit.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Feb 03 04:54:17 2014 +0000
+++ b/main.cpp Mon Feb 03 05:00:28 2014 +0000
@@ -6,21 +6,27 @@
#define MBED_APPS_BOARD
DigitalOut myled(LED1);
+
#if defined(MBED_APPS_SHIELD)
- C12832_LCD lcd(D11, D13, D12, D7, D10);
+ PwmOut spkr(D6);
#elif defined(MBED_APPS_BOARD)
- C12832_LCD lcd(p5, p7, p6, p8, p11);
+ PwmOut spkr(p26);
#else
#error application board not defined
#endif
-int main() {
+int main()
+{
while(1) {
- myled = 1;
- wait(0.2);
- myled = 0;
- wait(0.2);
- lcd.locate(0,0);
- lcd.printf("Hello IoT Workshop\n");
+ for(int j=0; j<3; j++) {
+ for (float i=2000.0; i<4000.0; i+=100) {
+ spkr.period(1.0/i);
+ spkr=0.5;
+ wait(0.1);
+ myled = !myled;
+ }
+ spkr=0.0;
+ wait(2.0f);
+ }
}
}