I have been trying to send four bytes of data between two Arduino DUE with SPI which I have sought of to manage to get working
I have been able to send and receive individual bytes and put them into an array the issue I'm having is the order that the bytes are in the array as once I have received all four bytes it puts it back into a long int
so for example when I upload the code the bytes are received from the slave are in this order 113,69,10,1
but another time I upload the code or reset the Arduino the bytes are received in this order 69,10,1,113
What I was thinking to get around this is send a char or some character For example "\n" which is displayed as a number 10. then work out where that is in the array and reference the other numbers from that spot
But for example if one of the bytes is number 10 As the four bytes of data will change depending on what long int is being sent, how do I distinguish between the number 10 and the char 10
as in 10,113,69,10,1
I might have misunderstood some think all they could be a completely better way of receiving four bytes from the slave
Your help would be much appreciated
jim