Hi All - I'm new so if any of the below is wrong please forgive me.
I currently have a program created that is checking for any incoming information from a piece of software running on a windows 10 PC - Using Serial.available and Serial.read I have managed to see this data and depending on the string that it reads i get lights flashing.
Sending serial is my problem - The software accepts simple serial strings such as START - I have been told by the developer that as long as it has a line feed at the end it should work such as Serial.print("START"); - This should send a string via serial with a new line marker.
Using Serial Monitor and a program called Serial Port Monitor I can see the commands coming from the Arduino - As soon as I stop using those and load the program up serial is being red ok but the software doesn't receive my commands.
It almost seems as if a handshake or a wait needs to happen before I can send my commands - The software only sends a command if a state changes on the software.
Could this be a buffer? or handshake required? or something else - Please help.
I have tried Serial.Println as well - My understanding was that Serial.print would do a new line and Serial.Println would do a new line with carriage return, or is a new line feed different?
I am right in thinking that Serial.println("START"); would send a string though?
Yeah there is definitely something stopping the command getting to the unit but I think i will need get a full time programmer to look into it.
I'm just confused why I can read the data when it comes to the Arduino but cannot send it out to the software. Could it be related to the PC com port settings?
I have tried Serial.Println as well - My understanding was that Serial.print would do a new line and Serial.Println would do a new line with carriage return, or is a new line feed different?
Serial.print() adds nothing to your string.
Serial.println() adds a carriage return and a line feed.
.print() does just that, it prints the characters, nothing more. .println() adds a carriage return and a new line (two "unprintable" characters, '\r' and '\n'). If you only want "START" with a new line you can do .print("START\n")
String's are just something in programming, in serial communication there is no such thing. In serial here are only received bytes. No link whatsoever between them. That's just something we "assign" in software.
And might be the software serial setting, if it uses a different baud rate or different number of stop bits etc it will not work.
I have tried the "START\n" and "START\r" and still not working.
It must be a software setting hopefully I can get a bit more information from the developer of the software. They seem to believe it is not the software as it only takes in simple serial commands, so must be a communication issue with Arduino.
Feedback via the software via serial is working perfectly - I'm receiving a String via serial and depending on the string received the unit will do different things.
Just to note I have tried a fresh program just sending a serial command to rule out any other programming issues.
I currently have a program created that is checking for any incoming information from a piece of software running on a windows 10 PC - Using Serial.available and Serial.read I have managed to see this data and depending on the string that it reads i get lights flashing.
So, you are able to get data FROM the device, but not, apparently, able to send data TO the device. Doesn't seem like a serial port configuration issue, to me, then.
There may be handshaking issues, where the software only reads incoming data under certain conditions. What those conditions would be, though, or how to trigger them, I haven't a clue.