Hi everyone :),
Currently I m doin this project on communication between Arduino UNO and Hyperterminal through XBee WiFi module. I ad configured the WiFi module using SKXbee with X-CTU and it also works fine when communicating between X-CTU and Hyperterminal.
But problems came when the module was tested with UNO and Hyperterminal. The Arduino was able to send message to Hyperterminal, bt then the arduino couldn't receive message from the Hyperterminal.
My Arduino Codes:
char msg = ' ';
const int led = 13;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("------------------");
delay(1200);
Serial.print("+++");
delay(1200);
bool bOK = false;
// while (Serial.available() > 0) {
// Serial.write(Serial.read());
// bOK = true;
// }
msg=Serial.read();
if(msg=='H') {
bOK = true;
}
if(bOK)
{
Serial.println();
Serial.println("ATDB");
delay(100);
while (Serial.available() > 0) {
Serial.write(Serial.read());
}
Serial.println();
Serial.println("ATCN");
delay(100);
while (Serial.available() > 0) {
Serial.write(Serial.read());
}
Serial.println();
}
if(msg=='H') {
digitalWrite(led,HIGH);
Serial.println('H');
}
Serial.println();
}
Since I m new to Arduino and XBee, anyone has any ideas which can help on this? Any help will be appreciated. Thks