In today's session we started by looking at Tinkercad and getting to grips with the basics of sound.
For step 1, we'll be signing into Tinkercad. To do that, follow this link here for instructions.
Once signed in, cick on Circuits on the dashboard on the left. Then, click Create New Circuit.
To start making our Synthesiser we'll need three things:
An Arduino Uno R3
A Piezo (speaker)
A Resistor
You can find all these things in the components panel on the right. Drag them into the empty Design Area.
Next we need to wire the circuit together. Each component needs to be a part of a complete circuit. That means Electricityy must have some sort of path from the Voltage In to the GND (ground). Use this guide:
Connect a wire from one of the GND pins on the Arduino to the Negative connection on the speaker.
Connect a wire from Pin 9 of the Arduino to one end of the Resistor.
Connect a wire from the other end of the resistor to the Positive connection on the speaker.
You can hover your mouse over each connection to find out which is which.
A resistor limits the amount of electricity that can be passed through. By placing our resistor between Pin 9 and the Speaker we can turn the volume of the speaker down.
Click on the Resistor. A Blue box should appear. In the blue box, change the bottom number to something like 50 kΩ. The higher the number, the quieter the speaker.
Now we can click on the Code panel up in the top right. This lets us program our Synthesiser.
When you open the Code Panel for the first time you will find that there are already some blocks there. We can delete these by dragging them into the bin in the bottom right.
Now we can add our own code! In the Output panel we can find a block called "play speaker on pin 0 with tone 60 for 1 sec".
Drag that out into the code window and change pin 0 to pin 9.
Press Start Simulation and listen!
Now our Synthesiser is making noise, we can expand our code. We can change the tone by typing in higher or lower numbers.
We can also compose small songs by using a combination of more play speaker blocks and wait 1 seconds blocks (found in Control).