You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Nov 29, 2016 10:04 PM, "nindidooo" ***@***.***> wrote:
I'm trying to send a string of up to 54 characters from master to slave.
The characters are integers from 0 to 1000. Could you tell me how to do
this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGLKn4glULuhaMf1R2AThv6TbWPLT6J3ks5rDOfKgaJpZM4K_wKq>
.
By default you already have 250 bytes in the message buffer. That is more than enough for 54 characters.
If it's just a normal text string you can:
icsc.send(20, 'F', myString);
This is the same as:
icsc.send(20, 'F', myString, strlen(myString));
If it is an array of byte values you need to include the size of the array:
icsc.send(20, 'F', myData, 54);
For larger data types you need to cast it and make sure you give it the byte count. For 16-bit integers:
icsc.send(20, 'F', (uint8_t *)myData, 108);
sizeof() is useful for this, since it gives the byte size (as long as it's in the same scope as the definition of the array since it's calculated at compile time, not runtime):
I'm trying to send a string of up to 54 characters from master to slave.
The characters are integers from 0 to 1000. Could you tell me how to do this?
The text was updated successfully, but these errors were encountered: