Questions:

  1. In this lab, only the second sensor works for both my friend's and my breadboard. We also change the resistor of the sensor, but it is not working as well. Why is it happened? Is it because there is not enough voltage to support this lab?

    截屏2021-09-27 下午6.04.00.png

Analog Output

截屏2021-09-25 下午5.37.32.png

Pseudo-analog output:

  1. PWM—-analogWrite— the bits from 0~255 (percentage of the time) instead of low or hight

截屏2021-09-25 下午5.54.03.png

截屏2021-09-25 下午5.55.22.png

  1. LED begins off, then brighter and brighter

截屏2021-09-25 下午5.56.42.png

截屏2021-09-25 下午5.58.17.png

  1. tone(xx, frequency, duration)
  2. write it in the servo library: needs to define the servo and its range from(0 degree to 360 degree)

截屏2021-09-25 下午6.10.22.png

this code let servo moves slowly and smoothly

截屏2021-09-25 下午6.15.43.png