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: C12832 LM75B mbed EthernetInterface mbed-rtos
buzzer_music.h
00001 #pragma once 00002 00003 #include "mbed.h" 00004 #include <string> 00005 00006 #define MAX_ARRAY_LENGTH 17 00007 00008 namespace ProjectOne{ 00009 00010 class BuzzerMusic{ 00011 public: 00012 /* 00013 * Constructor for BuzzerMusic class. 00014 * 00015 @param pin that has a connection to the speaker on application board. 00016 @return Nothing. 00017 */ 00018 BuzzerMusic(PinName speakerPin=p26); 00019 00020 /* 00021 * Method that plays music when passed an index. 00022 * 00023 @param String that contains the x and y index (x-y). 00024 @return Nothing. 00025 */ 00026 void playMusic(string indexes); 00027 private: 00028 const static int frequencies[MAX_ARRAY_LENGTH]; 00029 const static int lengths[MAX_ARRAY_LENGTH]; 00030 const static int delays[MAX_ARRAY_LENGTH]; 00031 PwmOut speaker; 00032 }; 00033 00034 };
Generated on Sat Jul 23 2022 22:59:36 by
1.7.2