기술문의 :)

기술문의 게시판 입니다.

뒤로가기
제목

connect가 안됩니다.

작성자 안승하(ip:)

작성일 2014-08-05 16:11:51

조회 50

평점 0점  

추천 추천하기

내용

 해당 블루투스를 연결을 다 하고 안드로이드와 통신을 시도하려고 해고 start의 빨간 불만 깜빡 거리고

connect의 녹색불은 깜빡이지 않습니다.


RX는 흰색선 TX는 검은색선 VCC는 초록색선 GND는 주황색선 입니다.


아래는 소스 코드 입니다.


#include

int bluetoothTx = 2;  // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3;  // RX-I pin of bluetooth mate, Arduino D3

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
  Serial.begin(9600);  // Begin the serial monitor at 9600bps

  bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
  bluetooth.print("$");  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");  // Enter command mode
  delay(100);  // Short delay, wait for the Mate to send back CMD
  bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  bluetooth.begin(9600);  // Start bluetooth serial at 9600
}

void loop()
{
  if(bluetooth.available())  // If the bluetooth sent any characters
  {
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read()); 
  }
  if(Serial.available())  // If stuff was typed in the serial monitor
  {
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
  }
  // and loop forever and ever!
}




첨부파일

비밀번호
수정

비밀번호 입력후 수정 혹은 삭제해주세요.

댓글목록

등록된 댓글이 없습니다.

댓글 수정

이름

비밀번호

내용

/ byte

수정 취소

비밀번호 :

확인 취소

댓글 입력

이름

비밀번호

내용

/ byte

평점

왼쪽의 문자를 공백없이 입력하세요.

회원에게만 댓글 작성 권한이 있습니다.

관련 글 보기

follow us