Hello forum.arduino.cc,
I'm relatively new to Arduino. I've tinkered wit them a little, but nothing big, really.
A few days ago, a friend of mine suggested that we could add a speaker to a project we're working on to make it play Africa by Toto in an 8-bit fashion.
I soldered some wires to an old speaker that we salvaged from a walkie-talkie, connected it to my Nano, and uploaded a basic C3 to C4-sketch. It uploaded fine after I changed the processor to the ATmega328P (Old Bootloader).
Now here's the thing: when I tried to upload the actual music sketch, the Port menu was greyed out, so I couldn't select COM3. I verified the sketch and it contained no bugs. However, when I tried uploading the sketch, it didn't work at all.
The error message read: avrdude: ser_open(): can't open device "\.\COM3": Het systeem kan het opgegeven bestand niet vinden. (The system can't find the specified file)
My details:
- OS: Windows 8.1
- Arduino IDE Version: 1.8.7
- Arduino: Nano, ATmega328P with the old bootloader (not exactly sure what that means)
And finally my code:
int tonePin = 3;
void setup() {
}
void midi() {
tone(tonePin, 110, 136.5);
delay(150.0);
delay(300.0);
tone(tonePin, 277, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 277, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 110, 136.5);
delay(150.0);
tone(tonePin, 277, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 246, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 138, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 369, 136.5);
delay(150.0);
tone(tonePin, 329, 136.5);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
tone(tonePin, 329, 136.5);
delay(150.0);
delay(300.0);
tone(tonePin, 277, 136.5);
delay(150.0);
delay(300.0);
tone(tonePin, 277, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 277, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 110, 136.5);
delay(150.0);
tone(tonePin, 277, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 246, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 329, 136.5);
delay(150.0);
delay(150.0);
tone(tonePin, 369, 136.5);
delay(150.0);
tone(tonePin, 329, 136.5);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
delay(150.0);
tone(tonePin, 329, 136.5);
delay(150.0);
}
void loop() {
// Play midi
midi();
}
Thanks in advance,
WalrusGumboot