Hi,
I'm almost new to using the Arduino Nano, learning as I go.
Problem I have is that I get 1 or maybe 2 lines of data correct when receving data with SoftwareSerial.
Any ideas or suggestions very much appreciated!!
This is code I'm using (not to complicated): #include <SoftwareSerial.h>
SoftwareSerial HMRdisplay(2, 3); //pin D2 = rx, D3 = tx
void setup()
{
// initialize serial communication:
Serial.begin(9600);
HMRdisplay.begin(9600);
}
void loop()
{
while (HMRdisplay.available())
{
Serial.write(HMRdisplay.read());
}
}
and this is an example of what the data might look like (first line is correct, then garbage):
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 1234567890 DE
HQI RNF USVRH Z G2479D T IKRWFXUSORT Z G1469 T UKBWFXUPORT A O1369
TEUKBW XUPO
ETEAYO1368 E
EUCBW XJP E EAYO 3580E
Do you have any suggestion for another way to do it, all I will send is ASCII-chars.
I just took the example that came with SoftwareSerial and made some minor adjustments.
Tried suggestion above but no change
Found that it I lower the speed from 9600 to 4800 it works perfect, but surely it must be possible to run faster than 4800??
Should maybe have mentioned before that I have a MAX232 in between the sender equipment and my Nano, and I can run the MAX232 at much higher speeds.
I'm using a "GN Navtel Datatest 3" to send data, but it will not be used once this is working.
I lower the speed on the Navtel and of course also in the code:
HMRdisplay.begin(4800);
the above setting works fine.