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 SparkfunAnalogJoystick mbed-rtos mbed SDFileSystem
Fork of 4180FinalLab by
soundBuilder.h
- Committer:
- Mpmart08
- Date:
- 2016-04-26
- Revision:
- 6:9cdde66d7502
- Parent:
- 3:591086e44bf9
File content as of revision 6:9cdde66d7502:
#include "Speaker.h"
class Note
{
public:
// Constructor
Note ();
Note (float, float, float);
// setters
void setFreq(float);
void setLength(float);
void setVolume(float);
// getters
float getFreq();
float getLength();
float getVolume();
private:
float freq;
float length;
float volume;
};
class SoundBuilder
{
public:
// Set Song
SoundBuilder (float [], float [], float [], int, Speaker *);
// Set sound, where int is the note number starting from 0
void setNote(float, float, float, int);
// Play Sounds
void playNotes(int, int);
// Play Songs
void playSong();
// Clear Songs
void clearSong();
private:
Note song[20];
Speaker *speaker;
};
