How to create data array?

How can I create an array of data to send to the com port from this example?

Hi @Vadimkuzmin,

Guess the only relevant data is the stretch value of the handles. So collect them to an array and send it via com port. Maybe you can add an id to it to be able to distinguish the different values …
To send and receive data you can use

— mnse

Collecting into an array, sending, reading (in the Arduino) provokes several questions or decisions about what to do. Send the whole set each time? Or Send one each time it changes (with the ident of which one that was.) Send as text or binary? How to identify the start and end of messages? The examples given with the Serial library don’t tell you how to send multi-values. To get quickly past all this I wrote an example, which will almost certainly work first time. One way forward is to run that, then substitute your own data.

1 Like