Hi everyone, I'm trying to interface with another microcontroller. I need to send strings such as "ATE0\r" from my arduino to this other MCU. It works if i do this:
mySoftSerial.print("ATE0\r");
however, I need to be able to read in the string from a phone/PC on another serial connection and i havent been able to get it to work yet. I tried reading in the string as a char array such as:
str[0] = 'A', str[1] = 'T'....str[4] = '/r';
Anyone have any suggestions as to how I can read in a string from Serial.read() and send that same exact string with mySoftSerial.print()
Thanks for the help.
Yes, here is my code that works. I'm trying to accomplish this same result, but instead of hard-coding the mySerial.print() message, i want to read it in from the user and pass it on.
NewSoftSerial mySerial(2, 3);
int count = 0;
void setup()
{
Serial.begin(9600);
// set the data rate for the NewSoftSerial port
mySerial.begin(9600);
}
void loop() // run over and over again
{
while(mySerial.available() == 0);