HC-06 블루투스 모듈 2

Bluetooth 통신

#include <SoftwareSerial.h>
 
int bTx=2;
int bRx=3;
SoftwareSerial BT(bTx, bRx);

void setup() 
{
  Serial.begin(9600);
  BT.begin(9600);
}

void loop()
{
  if(BT.available()) {       
    Serial.write(BT.read());
  }
  if(Serial.available()) {         
    BT.write(Serial.read());
  }
}


휴대폰과 연동


다운로드