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: mbed N5110 ShiftReg PinDetect
Music.cpp
00001 #include "Music.h " 00002 00003 /// @file Sound.cpp 00004 00005 Sound::Sound(PinName buzzerPin) 00006 { 00007 //dac = new Tone(p18); 00008 } 00009 00010 Sound::~Sound() 00011 { 00012 // delete dac; 00013 } 00014 00015 void Sound::playNote(Note ¬e) 00016 { 00017 /* 00018 start(); 00019 buzzer->period(1.0/note.frequency); 00020 ticker.attach(this, &Sound::stop, 0.5 * note.beat); 00021 */ 00022 } 00023 00024 // Sound effects - definitions 00025 namespace SFX 00026 { 00027 Note PLAYER_DEAD(1174.66, 0.2); 00028 Note ENEMY_DEAD(1567.98, 0.1); 00029 Note BULLET_FIRED(1661.22, 0.1); 00030 Note PLAYER_JUMP(1760.00, 0.2); 00031 Note RESTART(1318.51, 1.0); 00032 }
Generated on Tue Jul 12 2022 21:30:55 by
1.7.2