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 FXOS8700CQQQ
GameTones.cpp
00001 #include "GameTones.h" 00002 00003 //default constructor 00004 GameTones::GameTones(){ 00005 } 00006 // destructor of the class 00007 GameTones::~GameTones(){ 00008 } 00009 00010 void GameTones::End_Game_Melody(Gamepad &pad){ 00011 pad.tone(300,1);//makes a tone to indicate gameover 00012 wait(0.25); 00013 pad.tone(450,1);//makes a tone to indicate gameover 00014 wait(0.25); 00015 pad.tone(300,1);//makes a tone to indicate gameover 00016 wait(0.5); 00017 pad.tone(450,1);//makes a tone to indicate gameover 00018 wait(0.25); 00019 pad.tone(300,1);//makes a tone to indicate gameover 00020 wait(1); 00021 } 00022 00023 00024 void GameTones::Play_Welcome_Melody(Gamepad &pad) { 00025 pad.tone(500, 1);//plays a tone at frequency 500hz 00026 wait(0.5);//small delay 00027 pad.tone(300, 2); //plays a tone at frequency 300hz 00028 wait(0.5); 00029 pad.tone(400, 2); //plays a tone at frequency 400hz 00030 wait(1.5); 00031 pad.tone(450, 0.2);//plays a tone at frequency 450hz 00032 wait(0.25); 00033 pad.tone(400, 0.2); //plays a tone at frequency 400hz 00034 wait(1); 00035 00036 }
Generated on Mon Jul 18 2022 07:45:10 by
1.7.2