Androi d Blue Tooth L 298 N Arduino
架構圖 Androi d Blue. Tooth L 298 N 輪胎 Arduino (UNO) L 298 N 刷毛 吸塵風扇
移動程式碼 char i; void loop() { 後退 int forword=10, rev=11, a=5, b=6; byte cmmd[20]; if(I 2 CBT. available()){ 左轉 i=I 2 CBT. read(); Serial. println(i); } 前進 前進 if(i==‘a’){ analog. Write(forword, 255); analog. Write(rev, 0); analog. Write(a, 255); analog. Write(b, 0); } 後退 if(i==‘b’){ analog. Write(forword, 0); analog. Write(rev, 255); analog. Write(a, 0); analog. Write(b, 255); } 停止 if(i==‘c’){ analog. Write(forword, 255); analog. Write(rev, 0); analog. Write(a, 0); analog. Write(b, 255); } if(i=='d'){ analog. Write(forword, 0); analog. Write(rev, 255); analog. Write(a, 255); analog. Write(b, 0); } if(i=='e'){ analog. Write(forword, 0); analog. Write(rev, 0); analog. Write(a, 0); analog. Write(b, 0); } }
- Slides: 12