I am a bit new to this and trying to find out if my problem is in my code or hardware setup. I am trying to send a command like “q200” over the TX line from the Photon to a TTL to RS232 adapter which hooks up to my machine. My machine should then send back something like “23” or “VF2D”
On my machine I have the following parameters to set for configuring serial communication:
Baud Rate
Parity Select
Stop Bit
Synchronization
RS-232 Data Bits
Leader To Punch
EOB Pattern
Add Spaces on RS232 Out
I have read that the Photon uses 8-n-1 so I have been trying that but I am wondering if some of the other settings could be wrong? I can connect, send and receive commands using a USB to RS-232 adapter and CoolTerm (by setting the additional parameters).
I thought something simple like this should start to show some info:
void setup() {
Serial.begin(9600);
Serial1.begin(38400);
}
void loop() {
delay(5000);
Serial1.print(“q102”);
Serial.print(Serial1.read());
}
Any help is appreciated!