For these two exercises, at first, I was not able to program the Arduino successfully. The failing message always showed as below. By asking the classmate, I found it was the problem with the setting. After correcting the setting, the program ran well and successfully.
Count button presses:
I added the code used before to make the counting more visualized. Now I could track the counting changes by watching the line's growth.
Long press, short press
I used both the serial monitor and IDE tool to present the low press and short press function.
At first, I didn't realize that I need to wrap the sensor with strings so that I failed my first try.
After watching the video and wrap them up together (as shown below), I began my second try.