Hi.
I am trying to interface Arduino with p3dv4
Sending data from lua script to Arduino is fine. And no problem receiving data in arduino side.
To read data coming from arduino in lua script, I really like the event.com concept. It makes (or should) things easy.
The idea is to isolate a string between '/n' or whatever character, so I can manage a string as a complete comand.
The comands I send from arduino have the format "A=xxxxx/n", and I have manage to isolate the key 'A' and the number xxxxx
But I having problems to isolate the "A=xxxxx" and not being mixed with the command before or behind.
This is an example code:
I am sending the data from arduino every 500 milisecs. Quite slow, to be sure no problems with buffers.. (I think).
I have test '/n', 13, even other characters like 'X', space. But the string comes truncated. I see it with ipc.display (strng)
Only works if using
I don't know the reason. Is '/n' two bytes and then total lenght is 9 perhaps..?
With the 9, I see in the ipc.display window a blank line, and in the next line the complete code. So, it works in this way. I can use this method if always sending the same commands lenght...
But I would like to use diferent string lengths with "term" parameter working.
What I am doing wrong? 😕
thanks in advance
Arturo.