当前位置:   article > 正文

基于arduino 蓝牙麦克拉姆轮小车_arduino蓝牙两轮车

arduino蓝牙两轮车

#include <SoftwareSerial.h> 
// Pin10接HC05的TXD
// Pin1接HC05的RXD
SoftwareSerial BT(0, 1); 
char val;
int L1_IN1 = 7;int L1_IN2 = 5;int L1_ENA = 6;//左前轮
int R1_IN1 = 4;int R1_IN2 = 2;int R1_ENA = 3;//右前轮
int L2_IN1 = 12;int L2_IN2 = 13;int L2_ENA = 11;//左后轮
int R2_IN1 = 8;int R2_IN2 = 9;int R2_ENA = 10;//右后轮
int sp=200;
void setup() {
  // put your setup code here, to run once:
  pinMode(L1_IN1, OUTPUT);pinMode(L1_IN2, OUTPUT);pinMode(L1_ENA, OUTPUT);
  pinMode(R1_IN1, OUTPUT);pinMode(R1_IN2, OUTPUT);pinMode(R1_ENA, OUTPUT);
  pinMode(L2_IN1, OUTPUT);pinMode(L2_IN2, OUTPUT);pinMode(L2_ENA, OUTPUT);
  pinMode(R2_IN1, OUTPUT);pinMode(R2_IN2, OUTPUT);pinMode(R2_ENA, OUTPUT);

  
  Serial.begin(9600);
  Serial.println("bluetooth is ready!");
  BT.begin(9600);
}
 
void loop() 
{

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/1012992
推荐阅读
相关标签
  

闽ICP备14008679号