Lab 1

1,test the force sensor,then it works!

2166_1790625418.mp4

21651790625418_.pic.jpg

2, FSR control the 3 voices of audiop track

21701790630635_.pic.jpg

2171_1790630635.mp4

This lab introduced me to using Arduino to create sound output with a piezo speaker. I learned how to use the tone() function to control the frequency and duration of sounds. Through changing different values, I was able to understand how code can control pitch and create simple melodies. This lab helped me build a basic understanding of the relationship between digital output and physical interaction.

Lab 2

2169_1790627618.mp4

21681790627618_.pic.jpg

This lab taught me how to control a Servo Motor using an Arduino. The Servo library allows the Arduino to output control signals, causing the servo to rotate at a set angle. In the experiment, I connected the servo to the Arduino's power supply, ground pin, and digital pin, using the attach() function from the Servo.h library to connect the servo, and then controlling the servo's angle using the write() function. For example, I set 0°, 90°, and 180° and observed the changes in the servo's position. This lab helped me understand how Arduino controls physical devices through code and familiarized me with the relationship between output devices and program logic. Because the Arduino's loop() function runs continuously, the servo will continuously execute the set actions. Through this experiment, I learned how to combine code and hardware to achieve simple physical interactions.