Hugo Hu / Mbed 2 deprecated BRAVEHEART

Dependencies:   mbed N5110 ShiftReg PinDetect

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Music.cpp Source File

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 &note)
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 }