Blog

Analog Output with Tone

I find setting up the breadboard hardware is fairly easy since the diagrams are so well illustrated, and as long as you keep track of all the main components needed:

  • ground and power all connected in the right wells and rows so that there are no “breaks” in the circuit.

  • appropriate resistor strengths between positive input and the component getting powered (ex. LED).

I found programming a little more difficult; while the Arduino interface looks really similar to p5.js, for a complete beginner it’s different enough to throw me off. I sort of went through the motions on this particular Lab, but a big concept I came away with was:

  1. test the code within the program by running a Serial.println before connecting your board to power. this is an easy way to make identify if there is an issue within the lines of code before you rip apart a perfectly good circuit.

  2. test the circuit set up with a simple test like “solid tone” to ensure that your circuit is set up correctly before you start looking into the code to change things when really you might just be missing a small connection point or misplaced a wire in a well.

    • in this step I found that the identifying numbers in my lines of code did not match what I had set up in Arduino, I plugged something into well 7 but code called 8.

  3. try the full thing to make sure it does what you want it to do.

    • in this step, I didn’t get the tone I was expecting to because the sample map values were incorrect. I understand this conceptually, but I’m not sure I understand how to get the correct values that I want just yet. I don’t really know how to evaluate for the right numbers. Brian helped me with this.

    • https://vimeo.com/380354933 < might have to watch this a couple more times

Success!! (Finally….)