Sonny-xby

蓝牙模块设置

void setup() {
  // put your setup code here, to run once:
  Serial.begin(38400);

}

void sendcmd()
{
    Serial.println("AT");
  while(Serial.available())
  {
    char ch;
    ch = Serial.read();
    Serial.print(ch);
  } // Get response: OK
  delay(1000); // wait for printing 


  Serial.println("AT+NAME=14jxcheng");
  while(Serial.available())
  {
    char ch;
    ch = Serial.read();
    Serial.print(ch);
  }
  delay(1000);

  Serial.println("AT+ADDR?");
  while(Serial.available())
  {
    char ch;
    ch = Serial.read();
    Serial.print(ch);
  }
  delay(1000);

  Serial.println("AT+PSWD=1125");
  while(Serial.available())
  {
    char ch;
    ch = Serial.read();
    Serial.print(ch);
  }
  delay(1000);

}


void loop() {
    sendcmd();
}

 

分类:

技术点:

相关文章:

  • 2021-12-14
  • 2022-01-07
  • 2022-01-08
  • 2021-05-23
  • 2021-04-21
  • 2021-07-29
  • 2021-11-28
猜你喜欢
  • 2021-12-22
  • 2021-12-02
  • 2021-12-17
  • 2021-12-12
  • 2021-12-04
  • 2021-12-19
  • 2021-12-06
相关资源
相似解决方案