Re: [3.1]How serial send 0xa5a5 so correctly received & tested in 4byte structure?
- Posted by DanM_anew Apr 09, 2014
- 2187 views
DerekParnell said...
DanM_anew said...
... the structure suggested for the Arduino program said,
"uint32_t syncPattern; / /4 bytes with a fixed value, e.g. 0xa5a5, marks the beginning of a header",
Ok, so we still have two options, depending on if its a big-endian or little-endian CPU.
The two equivalent byte streams in Euphoria would be ...
constant sync_BE = {#00, #00, #A5, #A5} constant sync_LE = {#A5, #A5, #00, #00} -- Typically Intel machines.
Well I'll be! Your little-endian WORKS! I truly don't understand why it should be
sync_LE = {#A5, #A5, #00, #00}
rather than
sync_LE = {#A5,#00,#A5,#00}
but right now I don't CARE! It works, that's good enough for me to proceed from!
THANK YOU DEREK!

