My Robot Art Show was not a success. I attempted to code a complex song called "Lullaby of Birdland" onto an Arduino in an attempt to have different parts of the chords played by multiple buzzers at the same time. However, because of unexpected complications that arose because of the Covid 19 outbreak, I was unable to get the large amounts of troubleshooting that I needed to turn my code into something functional.
int Buzzer1 = 3 //sets pin 3 as output for buzzer 1
int Buzzer2 = 5 //sets pin 5 as output for buzzer 2
int Buzzer3 = 6 //sets pin 6 as output for buzzer 3
int Buzzer4 = 9 //sets pin 9 as output for buzzer 4
int Buzzer5 = 10 //sets pin 10 as output for buzzer 5
void setup()
{
pinMode(Buzzer1, OUTPUT); //set the output pin for buzzer 1
pinMode(Buzzer2, OUTPUT); //set the output pin for buzzer 2
pinMode(Buzzer3, OUTPUT); //set the output pin for buzzer 3
pinMode(Buzzer4, OUTPUT); //set the output pin for buzzer 4
pinMode(Buzzer5, OUTPUT); //set the output pin for buzzer 5
pinMode(Buzzer6, OUTPUT); //set the output pin for buzzer 6
}
void loop()
{
tone(Buzzer1, 392, 150);
tone(Buzzer2, 494, 150);
tone(Buzzer3, 82.4, 300); //Lul-
tone(Buzzer1, 392, 150);
tone(Buzzer2, 494, 150); //-la-
tone(Buzzer1, 440, 150);
tone(Buzzer2, 370, 150);
tone(Buzzer3, 123.5, 300); //by
tone(Buzzer1, 392, 150);
tone(Buzzer2, 330, 150); //of
tone(Buzzer1, 370, 150);
tone(Buzzer2, 247, 150);
tone(Buzzer3, 138.6, 600); //bird
tone(Buzzer1, 330, 150); //land
tone(Buzzer2, 247, 300);
tone(Buzzer1, 277, 300); //that’s
tone(Buzzer2, 233, 300);
tone(Buzzer3, 165, 600);
tone(Buzzer4, 92.5, 600);
tone(Buzzer1, 330, 150);
tone(Buzzer2, 185, 150);//what
tone(Buzzer1, 311, 750);
tone(Buzzer2, 220, 750); //I___
tone(Buzzer3, 123.5, 300);
tone(Buzzer3, 65.4, 300);
tone(Buzzer1, 247, 300); //al-
tone(Buzzer3, 165, 300);
tone(Buzzer1, 247, 1050); //-ways
tone(Buzzer2, 196, 1050);
tone(Buzzer3, 147, 300);
tone(Buzzer4, 370, 150);
tone(Buzzer4, 330, 750); //hear
tone(Buzzer3, 138.6, 300);
tone(Buzzer3, 131, 150);
tone(Buzzer3, 123.5, 150);
tone(Buzzer1, 261.6, 300);
tone(Buzzer2, 110, 300); //when
tone(Buzzer1, 262, 600);
tone(Buzzer2, 330, 600);
tone(Buzzer3, 494, 150);
tone(Buzzer4, 98, 300); //you
tone(Buzzer3, 440, 750); //sigh___
tone(Buzzer4, 92.5, 750);
tone(Buzzer4, 147, 100);
tone(Buzzer4, 139, 100);
tone(Buzzer4, 131, 100);
tone(Buzzer4, 123.5, 600);
tone(Buzzer1, 293.66, 600);
tone(Buzzer2, 370, 600);
tone(Buzzer3, 440, 600);
tone(Buzzer5, 587.33, 150); //Nev-
tone(Buzzer5, 587.33, 150); //-er
tone(Buzzer5, 523.25, 150); //in
tone(Buzzer5, 494, 150); //my
tone(Buzzer1, 293.66, 600);
tone(Buzzer2, 440, 150);
tone(Buzzer3, 165, 300); //word-
tone(Buzzer2, 247, 450);
tone(Buzzer3, 82.4, 300); //land,
tone(Buzzer1, 261.6, 450);
tone(Buzzer2, 330, 150);
tone(Buzzer3, 196, 450);
tone(Buzzer4, 110, 450); //could
tone(Buzzer2, 494, 150); //there
tone(Buzzer2, 440, 150); //be
tone(Buzzer1, 262, 600);
tone(Buzzer2, 311, 300);
tone(Buzzer3, 185, 600);
tone(Buzzer4, 147, 600); //ways____
tone(Buzzer2, 494, 150); //to
tone(Buzzer2, 440, 150); //re-
tone(Buzzer1, 247, 600);
tone(Buzzer2, 293.66, 1200);
tone(Buzzer3, 196, 450);
tone(Buzzer4, 98, 600); //veal
tone(Buzzer3, 147, 150);
tone(Buzzer3, 165, 300);
tone(Buzzer4, 131, 300);
tone(Buzzer1, 233, 600);
tone(Buzzer2, 440, 150); //in
tone(Buzzer2, 392, 150); //a
tone(Buzzer2, 262, 300);
tone(Buzzer1, 220, 600);
tone(Buzzer3, 165, 600);
tone(Buzzer4, 92.5, 600); //phrase
tone(Buzzer2, 392, 150); //how
tone(Buzzer2, 370, 150); //I
tone(Buzzer1, 220, 300);
tone(Buzzer2, 247, 300);
tone(Buzzer3, 156, 300);
tone(Buzzer4, 123, 300); //feel.
tone(Buzzer4, 62, 450);
tone(Buzzer1, 0, 450);
tone(Buzzer2, 0, 450);
tone(Buzzer1, 392, 150);
tone(Buzzer2, 494, 150);
tone(Buzzer3, 247, 300); //Have
tone(Buzzer1, 392, 150);
tone(Buzzer2, 494, 150); //you
tone(Buzzer1, 370, 150);
tone(Buzzer2, 440, 150);
tone(Buzzer3, 123, 300); //ev-
tone(Buzzer1, 330, 150);
tone(Buzzer2, 392, 150); //-er
tone(Buzzer1, 370, 150);
tone(Buzzer2, 247, 300);
tone(Buzzer3, 139, 600); //heard
tone(Buzzer1, 330, 450); //two
tone(Buzzer2, 196, 300);
tone(Buzzer1, 233, 300);
tone(Buzzer2, 277, 300);
tone(Buzzer3, 165, 600);
tone(Buzzer4, 93, 600); //tur-
tone(Buzzer1, 196, 150);
tone(Buzzer2, 330, 150); //-tle
tone(Buzzer1, 220, 750);
tone(Buzzer2, 311, 750); //doves__
tone(Buzzer3, 123, 300);
tone(Buzzer3, 62, 300);
tone(Buzzer1, 247, 300); //bill
tone(Buzzer3, 165, 300);
tone(Buzzer1, 247, 1050); //and
tone(Buzzer2, 196, 1050);
tone(Buzzer3, 147, 300);
tone(Buzzer4, 370, 150);
tone(Buzzer4, 330, 750); //coo
tone(Buzzer3, 138.6, 300);
tone(Buzzer3, 131, 150);
tone(Buzzer3, 123.5, 150);
tone(Buzzer1, 261.6, 300);
tone(Buzzer2, 110, 300); //when
tone(Buzzer1, 262, 600);
tone(Buzzer2, 330, 600);
tone(Buzzer3, 494, 150);
tone(Buzzer4, 98, 300); //they
tone(Buzzer3, 440, 750); //love
tone(Buzzer4, 92.5, 750);
tone(Buzzer4, 147, 100);
tone(Buzzer4, 139, 100);
tone(Buzzer4, 131, 100);
tone(Buzzer4, 123.5, 600);
tone(Buzzer1, 293.66, 600);
tone(Buzzer2, 370, 600);
tone(Buzzer3, 440, 600);
tone(Buzzer5, 0, 9000);
tone(Buzzer5, 587.33, 150); //That’s
tone(Buzzer5, 587.33, 150); //the
tone(Buzzer5, 523.25, 150); //kind
tone(Buzzer5, 494, 150); //of
tone(Buzzer1, 293.66, 600);
tone(Buzzer2, 440, 150);
tone(Buzzer3, 165, 300); //ma-
tone(Buzzer2, 247, 450);
tone(Buzzer3, 82.4, 300); //-gic
tone(Buzzer1, 261.6, 450);
tone(Buzzer2, 330, 150);
tone(Buzzer3, 196, 450);
tone(Buzzer4, 110, 450); //mu-
tone(Buzzer2, 494, 150); //-sic
tone(Buzzer2, 440, 150); //we
tone(Buzzer1, 262, 600);
tone(Buzzer2, 311, 300);
tone(Buzzer3, 185, 600);
tone(Buzzer4, 147, 600); //make
tone(Buzzer2, 494, 150); //with
tone(Buzzer2, 440, 150); //our
tone(Buzzer1, 247, 600);
tone(Buzzer2, 293.66, 1200);
tone(Buzzer3, 196, 450);
tone(Buzzer4, 98, 600); //lips
tone(Buzzer3, 165, 150);
tone(Buzzer3, 147, 600);
tone(Buzzer4, 185, 600);
tone(Buzzer1, 262, 600);
tone(Buzzer2, 294, 150); //when
tone(Buzzer2, 370, 150); //we
tone(Buzzer1, 247, 1350);
tone(Buzzer2, 294, 1350);
tone(Buzzer5, 0, 2850);
tone(Buzzer5, 392, 1350);
tone(Buzzer3, 98, 300);
tone(Buzzer4, 196, 300); //kiss!_____
tone(Buzzer3, 147, 150);
tone(Buzzer3, 165, 150);
tone(Buzzer3, 196, 300);
tone(Buzzer3, 185, 450);
while (true) {} //get stuck in this loop forever so that the song only plays once
}
void play(OUTPUT, currentFrequency, duration) //format for each note
{
delay(50); //a little delay between the notes makes the song sound more natural
}
I tried using this code by connecting six buzzers to the various to the various output pins in the code. When this didn't work, I used six different arduinos, each connected to their own buzzer. I also took out all of the code that was only relevant to buzzers other than what was needed for each singular buzzer.
As I stated above, this circut and code did not work as intended, and I am currently unable to fix it.
This law represents an equation that is able to tell the amount of static charge between two objects based on their distance and electrical charge. The equation is F = kq1q2/r^2. This law is also known as the inverse square law.
This type of circut is one that has multiple components that the same current travels through. The total resistance on the circut can be found by adding the resistance of all of the components in the series.
A parallel circut is a type of circut that has the current split into multiple pathways that are connected at their begginings and ends. The total resistance is found by adding the reciprocals of the resistance of all of the components, then taking the reciprocal of the sum to find the total resistance.
This concept is the rate of electrical flow past a particular point. It is represented by "I" in the equation V=IR.
This concept is the difference in electrical potential energy between two points. It is represented by "V" in the equation V=IR.
Thish concept is the amount that a component slows the current of a circut. It is represented by "R" in the equation V=IR.
Coding is a very complicated language that requires an incredible amound of practice to speak fluently. That being said, there are many resources that allow one to cobble together a functioning code. Many of the commands are self-explanatory and once a pattern is found, a rather inexperienced coder can get into the flow to create something completely original.
Electromagnets are man-made magnets that, like most other magnets, attract ferromagnetic materials, like iron and cobalt. These magnets can be created by wrapping a ferromagnetic material with wire from a highly conductive material. Once the wire is charged, a magnetic field will be created from the flowing of electrons from one side of the electromagnet to the other. The strength of the electromagnet can be increased with a stonger power source and greater contact between the wire and the ferromagnetic material.
Throughout this project, I had difficulty with getting my code to work. I think I did as good as I could communicating with my teachers throughout this project despite never seeing them in person to ask for help on the project. I think I also did my best at creative problem solving. Despite me never finding precisely how to get my code to work, I worked at it for a long time trying to fix the error meggages that constantly appeared.