i wanted to know can we use AT commands for the hc05/06 Bluetooth modules from the arduino leonardo i tried to do so but was unable to, i would really appreciate any help.
This page may help.
http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-at-mode/
Google "hc05 hc06 at mode" for more information.
the issue is they all use generic arduinos im trying to use it on a leonardo as its the only working one i have right now, arduino leonardo with hc05 AT commands dont seem to work and im trying to find out whats wrong
How are you connecting the Bluetooth modules to the Leonardo?
Are you using Serial1?
i connected the enable pin to 3.3v
vcc to 5v
gnd to gnd
RX to RX
TX to TX
I then uploaded a blank code in and opened serial monitor and set baud rate to 38400 and both NL&CR as told in tutorial i then typed AT waiting for a OK or any reponse but i didnt get any.
this is all i did
Because the Leonardo is a native USB board, you cannot use the blank sketch passthrough method to connect with the module. The usb serial is separate from Serial1 on the Tx and Rx pins.
You are going to have to follow the tutorials which don't use the blank sketch pass through method, but instead typically use a sketch with software serial and cross connected Tx>Rx and Rx>Tx. However, in the case of the Leonardo you don't use software serial, but instead use Serial1. You will need to send the AT commands from the serial monitor using Serial (usb serial) and then send then back out over Serial1.
i understood the wiring part but im not sure understanding the software side do you mind guiding me with "serial1"
Configure Serial1
Serial1.begin(someBaudrate);`
Read from bluetooth on Serial1 and print on serial monitor
if(Serial1.available())
{
Serial.write(Serial1.read());
}
tried this code still typing AT in serial monitor returns no value at the same 384000 rate and show both NL CR
Please post the code you are using, and describe the connections.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.