
alphanumeric35
-
Content Count
3 -
Joined
-
Last visited
Posts posted by alphanumeric35
-
-
-
Hi, i'm trying to run AT commands on HC-05 connected to MSP430G2553. The code below works on Arduino but i need to do it with MSP430. I changed the pins to match the MSP, tried to run the code but i see nothing on serial monitor. Total noob here and needs help.
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(3, 4);
void setup()
{
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.write("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}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());}
AT Commands with Software Serial on MSP430
in Energia - MSP
Posted
Thanks for the replies, i changed the pins, flipped some wires and it almost works!
The code looks like this now;
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(11, 12);
void setup()
{
pinMode(10, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(10, HIGH);
Serial.begin(9600);
Serial.write("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}
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());
}
}
When i send "AT", it returns some weird answer. You can see it in the image. What should i do to fix it?