Hallo, I have just ordered my Arduino and started to work on programming a bit. Well... I am quite new to Microprocessors and my c-experince is some years back. So sorry if I got something wrong (just tell me).
My problem is: I get a datastream from a Sensor (Cloud Droplet Probe) as a 156byte hex stream via serial.read. The datatypes are mixed up (uint, ulong, char, (fancy 48 bit unsigned Extra long which wont be accessible I think). The data will be stored in an byte array of that size to manipulate it. Well, the problem is that the byte orders are a bit crossed like it seems. ulong has byteorder 2,3,0,1 for example. I would like to assigne these values from the fields of the array to their appropriate belonging in the variabales. For example: Bin2Count is given by byte 38 to byte 41 in the stream and so I would like to assign unsigned long Bin2Count=data; unsigned long Bin2Count=data; unsigned long Bin2Count=data; unsigned long Bin2Count=data;
http://www.dropletmeasurement.com/manuals/Hardware%20Manuals/DOC-0029%20CDP%20Manual.pdf Page 33 shows the Byteorder.
Thanks in advance for your help.
I think appending to a string wouldn't work, because an unsigned long is an unsigned long and no string. Or maybe is it possible to create binary strings and append them? But as far as I remember conversions between characters and int weren't that nice.