BT를 이용한 아두이노 자동차 컨트롤
BT 모듈 - MHsoft로 검색이 된다.
pin code가 000000 « 이다. .ㅡ.ㅡ; 헐.. 이거.. bluetooth 4.0 인듯.. ㅡ.ㅡ; 안된다..
내린 결론… 통신은 되겠지만 컨트롤 APP을 만들어야 하는 번거로움이 있다..
그냥 HC-06사용하는걸루 방향 잡아야 할듯.
그냥 있는걸로 해야겠다 ㅡ.ㅡ;
HB02를 사용하자.. 얘는 1234다 ㅡ.ㅡ;
TEST source code (serial로 확인해야 해서 BT는 soft serial 로 연결했다.
PIN11 (RX), PIN 12(TX)
android APP은 그냥 arduion rc car로 검색하면 나오는 APP 을 사용했다.. 새로 짜기 귀찮아서리 ㅡ.ㅡ;
이슈1 : 움 신호는 가는데.. PC로 로그가 안나온다.. BT 속도 셋팅이 문제일수도 있다.
이건 내일 확인하는걸루..
#include
int bluetoothTx = 12; // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 11; // RX-I pin of bluetooth mate, Arduino D3
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
Serial.begin(9600);
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!
}