第6章 Arduino板常用外设与应用.pptx

第6章?Arduino板常用外设与应用;6.1 超声测距;6.1 超声测距;6.1 超声测距;6.2 蜂鸣器;6.2 蜂鸣器;6.3 温湿度传感器;6.3 温湿度传感器;6.3 温湿度传感器;6.3 温湿度传感器;6.4 直流电机;6.4 直流电机;6.4 直流电机;const int analogOutPin1 = 9; // 定义输出引脚 const int analogOutPin2 = 10; void setup() { int i; int j;} void loop() { for (byte i=150; i=254; ++i) { //150是最低值,不同电机启动值不同。 analogWrite(analogOutPin1, i); analogWrite(analogOutPin2, 0); delay(50); } analogWrite(analogOutPin1, 0); delay(2000); for (byte j=150; j=254; ++j) { analogWrite(analogOutPin2, j); analogWrite(analogOutPin1, 0); delay(50); } analo

文档评论(0)

1亿VIP精品文档

相关文档