ต่อ GND -> GND
VCC -> 5V
TX -> 7
RX -> 6
CODE ตามตัวอย่างด้านล่าง
ลองพิมพ์ AT ทำไม มันไม่ตอบสนองอะไร เลย ครับ ต่อเสร็จไฟ มันก็ ติดกระพริบ ถี่
พอ pair แล้ว ไฟก็ กระพริบห่าง 2 วิ เหมือน ปกติ แต่ ส่งค่าไปไม่ได้ เลยลองทำตามตัวอย่างใน Net
พิมพ์ AT มันก็ ไม่ตอบสนองอะไร เลย ไม่แน่ใจว่า เป็นที่ HC05 มันเสียหรือ เปล่า ครับ หรือ มีวิธีไหนตรวจสอบได้ ว่ามันเสีย
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(6, 7); // RX | TX
void setup()
{
pinMode(5, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(5, HIGH);
Serial.begin(9600);
BTSerial.begin(9600); // HC-05 default speed in AT command more
delay(1000);
Serial.println("Enter AT commands:");
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.write(Serial.read());
}
จ่ายไฟให้บอร์ด bluetooth แล้วใช้มือถือ สแกน bluetooth ถ้าขึ้นเจอ bluetooth น่าจะเป็นชื่อ HC-05 แสดงว่าใช้งานได้ครับ