plays a fucking annoying sound for 10 seconds and loops.
Dependencies: mbed
Fork of song_demo_PWM by
Revision 4:64c31855f0be, committed 2015-10-28
- Comitter:
- mganseij
- Date:
- Wed Oct 28 14:47:31 2015 +0000
- Parent:
- 3:89b8dea1cf17
- Child:
- 5:54dda16baec4
- Commit message:
- version whatever, this works.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| tones.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Oct 27 13:30:31 2015 +0000 +++ b/main.cpp Wed Oct 28 14:47:31 2015 +0000 @@ -4,7 +4,7 @@ // I apologize in advance for this fucking mess of a code -DigitalIn input(D15); +DigitalIn input(A4); PwmOut speaker(A5); SongPlayer mySpeaker(A5); Timer songTimer;
--- a/tones.h Tue Oct 27 13:30:31 2015 +0000
+++ b/tones.h Wed Oct 28 14:47:31 2015 +0000
@@ -88,10 +88,10 @@
#define NOTE_CS8 4435.0
#define NOTE_D8 4699.0
#define NOTE_DS8 4978.0
-#define notet 0.1
+#define notet 0.175
//Mario main theme melody
-/*float note[] = {
+float note[] = {
NOTE_E7, NOTE_E7, 0.0, NOTE_E7,
0.0, NOTE_C7, NOTE_E7, 0.0,
NOTE_G7, 0.0, 0.0, 0.0,
@@ -148,18 +148,19 @@
0.12,0.12,0.12,0.12,
};
-*/
+/*
float note[] =
{
- NOTE_E7, rest, NOTE_E7, rest, NOTE_E7, rest, NOTE_C7, rest, NOTE_E7, rest, NOTE_G7, rest,
- NOTE_C7, rest, NOTE_G6, rest, NOTE_E6, rest, NOTE_A7, rest, NOTE_B7, rest, NOTE_A7, rest, NOTE_A7,
- NOTE_G6, rest, NOTE_E7, rest, NOTE_G7, rest, NOTE_A7, rest, NOTE_F7, rest, NOTE_G7, rest, NOTE_E7, rest, NOTE_C7, rest, NOTE_D7, rest, NOTE_B6
+ NOTE_E6, NOTE_E6, NOTE_E6, NOTE_C6, NOTE_E6, NOTE_G6, rest,
+ NOTE_C6, NOTE_G5, rest, NOTE_E5, NOTE_A6, NOTE_B6, NOTE_A6, NOTE_A6,
+ NOTE_G5, NOTE_E6, NOTE_G6, NOTE_A6, NOTE_F6, NOTE_G6, NOTE_E6, NOTE_C6, NOTE_D6, NOTE_B5
};
float duration[] =
{
- notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet,
- notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet,
- notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet, notet
-};
\ No newline at end of file
+ notet, notet, notet, notet, notet, notet, notet,
+ notet, notet, notet, notet, notet, notet, notet, notet,
+ notet, notet, notet, notet, notet, notet, notet, notet, notet, notet
+};
+*/
\ No newline at end of file
