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: 4DGL-uLCD-SE PinDetect mbed SparkfunAnalogJoystick mbed-rtos
Fork of ECE2036Lab2StarterCode by
soundBuilder.h
00001 #include "Speaker.h" 00002 00003 class Note 00004 { 00005 public: 00006 // Constructor 00007 Note (); 00008 Note (float, float, float); 00009 // setters 00010 void setFreq(float); 00011 void setLength(float); 00012 void setVolume(float); 00013 // getters 00014 float getFreq(); 00015 float getLength(); 00016 float getVolume(); 00017 private: 00018 float freq; 00019 float length; 00020 float volume; 00021 }; 00022 00023 class SoundBuilder 00024 { 00025 public: 00026 // Set Song 00027 SoundBuilder (float [], float [], float [], int, Speaker *); 00028 // Set sound, where int is the note number starting from 0 00029 void setNote(float, float, float, int); 00030 // Play Sounds 00031 void playNotes(int, int); 00032 // Play Songs 00033 void playSong(); 00034 // Clear Songs 00035 void clearSong(); 00036 00037 private: 00038 Note song[20]; 00039 Speaker *speaker; 00040 00041 };
Generated on Fri Jul 15 2022 08:13:00 by
