Receiving serial data
Hi,
I have used 'serial' for a long time to send commands, however now I need to also receive data.
What I would like is to be able to read the text I receive back in other programs.
What is the easiest way to show text from the left output of 'serial'?
For example, I have a device that upon receiving a command will reply with either 'OK' or 'ERROR' followed by the error code. I'd like to be able to read this in Max and then use it in comment or textedit boxes.
Thanks
Anyone able to assist with this?
Thanks :)
set serial to proper port and baud rate
That's brilliant, thank you! :)
That pulls in the latest line from my device. In some scenarios, I expect upto 5 lines of text over the space of a few seconds, what is the best way to store all of the lines, not just the latest?
depends on the way you send messages.
sel 10 13 detects new line and so
outputs all collected data in zl group by banging it.
so any time you println in arduino, you get the output.
You can also prepend some sort of ID for messages
like :
A message 1 Error 3
or :
B message 2 All OK
In arduino use print for all, println for the last item in the mesage
In Max insert route A B C D etc to split messages by leading ID
----
or you just keep collecting data and println at the end of transmission
And then separate lines in max using zl objects or similar.
If you don't know how to do so, just post details about messaging
and what one has to deal with.
That woud make it easier to recommend something
So the device I'm working with today is a bluetooth controller. I send a 'search' command and it will list the bluetooth devices in range, line by line, then once the search is complete it will send 'OK'.
What I would like to do is list the devices it finds in a text box.
Thank you so much, that's exactly what I need! :)