Re: [3.1]How serial send 0xa5a5 so correctly received & tested in 4byte structure?

new topic     » goto parent     » topic index » view thread      » older message » newer message
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. 

Thanks Derek, I find things that say it's little-endian, but I'll have to test it, as I don't understand why you have the #00 pairs following the #A5 pairs rather than interspersed:

constant sync_LE = {#A5, #00, #A5 ,#00}  

And thanks for subtly reminding me to put all code in code format, I see that it does help, even for non Eu code!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu