fengzhihean

导航

2022年10月27日

模拟输出和输入;analog

摘要: 255是灯的最大亮度; 模拟输入analogRead(pin); //模拟输入引脚读取数值 1.模拟输出analogWrite(pin,参数) //通过参数的大小,控制引脚(比如说亮度) boolean pushButton1; boolean pushButton2; int LED=9; int 阅读全文

posted @ 2022-10-27 21:12 风止何安,璃月 阅读(522) 评论(0) 推荐(0)

pinMode(),digitalWrite()等

摘要: 1. 引脚悬空,没有确定的数字值,0与1是随机的。 2. digitalRead(pin);读取引脚的输入信息,将其显示在串口显示器中 3. pinMode(pin,mode);将引脚设置成某种模式。有三种模式:OUTPUT,INPUT,INPUT_PULLUP INPUT_PULLUP上拉模式:A 阅读全文

posted @ 2022-10-27 20:19 风止何安,璃月 阅读(484) 评论(0) 推荐(0)