I have a Sparkfun RS232 Shifter SMD part at the moment, and attached to that is a loopback serial connection (basically echoes back whatever is transmitted to it, I have tested this on another system and it is working). I am using this code:
#include <SoftwareSerial.h>
SoftwareSerial zytronics(2,3);
void setup()
{
Serial.begin(115200);
Serial.println("Start zytronics test");
zytronics.begin(9600);
}
void loop()
{
zytronics.print("Z");
while(zytronics.available())
{
Serial.print(zytronics.read());
}
delay(500);
}
And I never receive anything to read, despite it coming through (the RS232 shfiter is blinking both TX and RX lights indicating that both events are happening, as expected with a loopback).
What can I do to make this right?
EDIT: It's also worth noting that when I put my RX pin into the Digital pin 0 (the Arduinos RX) I can receive this data.