分享

Arduino 兩路L9110S馬達模組

void setup() {
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
analogWrite(5,0);
analogWrite(6,255);
analogWrite(9,0);
analogWrite(10,255);
delay(2000);
stop();
analogWrite(5,255);
analogWrite(6,0);
analogWrite(9,255);
analogWrite(10,0);
delay(2000);
stop();
analogWrite(5,0);
analogWrite(6,255);
analogWrite(9,255);
analogWrite(10,0);
delay(2000);
stop();
analogWrite(5,255);
analogWrite(6,0);
analogWrite(9,0);
analogWrite(10,255);
delay(2000);
stop();
}
void stop() {
analogWrite(5,0);
analogWrite(6,0);
analogWrite(9,0);
analogWrite(10,0);
delay(2000);
}
分類:學習

評論
上一篇
  • 下一篇
  • Arduino 避障紅外線模組
  • 更多文章
    載入中... 沒有更多了