Lab: Tone Output

This was my initial set-up (forgot to initially add resistor):

IMG_1756.HEIC

IMG_1757.HEIC

I tested my analog reader and speaker, and my analog worked but not my speaker.

analog working

I then messed with the circuit by moving around the resistor to see if that would help my speaker

IMG_1761.HEIC

IMG_1762.HEIC

And I replaced my speaker with another speaker to see if it was working because I soldered my actual speaker terribly (I ended up just getting better cables for my speaker).

IMG_1768.HEIC

The solution to my problem was that my resistor wasn’t complete in and the analog reading wasn’t in the correct pin for my speaker.

speaker working

However, when running the code with my circuit, it only worked during the upload part of compiling? But wouldn’t after that? it would also improve the length of how long it worked by getting rid of delay.

link to a video of this happening- the sound also just cuts off? - MUST ASK YESEUL ABOUT THIS

My initial setup (no ground on the diagram?)

IMG_1777.HEIC

My problem running it may have been writing pitches.h library incorrectly? I tried using the example code and github’s pitches.h, but it still wouldn’t work?

IMG_1775.HEIC

IMG_1776.HEIC