I tried to focus on understanding the connection of circuit and codes.
Q. I connected the distance sensor to Digital pin and it works. But I realized that distance sensor might be an analog sensor. Do I supposed to connected to Analog pin? or doesn’t matter…?
Q2. I set as Digital(OUTPUT) -> LED -> Resistor -> Ground.
But in most of the other examples, it was Digital(OUTPUT) -> Resistor-> LED-> Ground.
What is the difference?
+ I tried to add sound (tone) using speaker..
At first, It was a little bit confused to use tone() function to make a different pitch in each LED output.