I am using xbee series 1 with adafruit xbee adapter v1.1. I have connected one adapter to the computer and other one is connected to Arduino Leonardo. When I use Arduino Serial Monitor to send data (“cool”), I can see it in x-ctu terminal as shown in the image below. But when I try to use x-ctu terminal to transmit data like ”writehere”. I cannot see anything in the serial monitor of the Arduino. I am using following code. Please can you help?
- Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("Hello, world?");
}
void loop() // run over and over again
{
if (mySerial.available()) {
Serial.print((char)mySerial.read());
}
if (Serial.available()) {
mySerial.print((char)Serial.read());
}
delay(100);
}