Servo Motor

Turns 180 degrees based on pressure input from pressure sensor!!

 
We got the tone to play continuously but the little song wasn’t playing. We realized we pasted the code improperly and after fixing it, the tone played. There are two circuits here, one provides power, and the other transmits the information from the arduino, to the sensor, and back to the arduino. Blocking function: Function where the program doesn’t go to the next line until that line is executed. If this is being executed as an asynchronous function, both the tone and the delay command are executing at the same time. To test whether it’s blocking or asynchronous, you can make the delay longer than the sound, if the delay and sound both sound like they’re happening for the same amount of time, it’s asynchronous because they’re overlapping. If the delay is too long, you’ll miss readings because it is a blocking function so while you’re back to pressing, the program isn’t allowing the press to be read.

We got the tone to play continuously but the little song wasn’t playing. We realized we pasted the code improperly and after fixing it, the tone played.

There are two circuits here, one provides power, and the other transmits the information from the arduino, to the sensor, and back to the arduino.

Blocking function: Function where the program doesn’t go to the next line until that line is executed.

If this is being executed as an asynchronous function, both the tone and the delay command are executing at the same time. To test whether it’s blocking or asynchronous, you can make the delay longer than the sound, if the delay and sound both sound like they’re happening for the same amount of time, it’s asynchronous because they’re overlapping.

If the delay is too long, you’ll miss readings because it is a blocking function so while you’re back to pressing, the program isn’t allowing the press to be read.

 

Tone Output Using an Arduino

The last sensor didn’t play the lowest note like it was supposed to, it just stopped the continuous tone from playing like a pause button. All the wires became very messy, so in the future, I would use less of the thin wires and use the thick ones that you can cut to length.

The last sensor didn’t play the lowest note like it was supposed to, it just stopped the continuous tone from playing like a pause button. All the wires became very messy, so in the future, I would use less of the thin wires and use the thick ones that you can cut to length.

We changed the notes and pushed in all the wires and it started working  ¯\_(ツ)_/¯

We changed the notes and pushed in all the wires and it started working ¯\_(ツ)_/¯

Potentiometers are good for testing output because they are easy to control and you can keep it at the same value by just leaving it where you want to twist it to.

Previous
Previous

Week 2

Next
Next

Week 4