Even If i do need an external device that still doesn't help me with my current problem. I need to add an output sound to this code:
const int buttonPin = 2;
const int ledPin = 13;
const int spkrPin = 12;
int buttonState = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(spkrPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop(){
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(ledPin, LOW);
}
else {
digitalWrite(ledPin, HIGH);
if (buttonState == HIGH) {
digitalWrite(spkrPin, HIGH);
}
else {
digitalWrite(spkrPin, LOW);
}
}
}
This code is 1,096 bytes with a max capacity of roughly 32kb (30 i believe after proper allocation). I just want to add a simple snippet to the above in order to load and output a small 15kb file (half of available storage).
Thanks again for any assistance!