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

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

I'm trying to send MP3 data from Euphoria 3.1 program through a USB cable/port to an Arduino Uno running a program("sketch") that is, I think, written in a variant of C plus plus.

I had things beginning to work, thanks to Fernando, & ryanj, but I was testing it with text files, using something like the protocol ryanj suggested, and code suggestions from Fernando, and then realized that MP3 files could contain data which looks like header protocol control codes, so to eliminate that potential problem, I am now trying to instead use length of data info in header to read data on the Uno.

And a suggestion I got from the Arduino side involves using 'structures' (which is another thing I'm not familiar with), which include a 'sync' pattern to begin the header, eg. 0xa5a5, which in the suggested structure is: uint32_t syncPattern; //4 bytes with a fixed value

However, when I try to send that hex value, with sync = #A5A5, like this:

serial_puts(hCom1, sync & justFileName & lengthDATA & chkSUM 
           & dataChunk) 

I get an echo return from the Uno of 165, which is just the first #A5 portion of #A5A5. (And immediately following that is the actual data sent from the test file.)

What should I do to correctly send #A5A5 (0xa5a5) ? (So that it is received as the 4 bytes the Uno 'sketch' (program) structure expects.)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu