Accelerometer sample code
To understand this you have to start thinking in binary.

The | operator is "Perform a binary OR on these two values".

The &lt;&lt;8 is "Shift this value 8 bits to the left".

If you have two 8-bit values, say (in hex) 0x37 and 0x42, and you OR them together you get:

0x37 = 00110111 
0x42 = 01000010 
--------------- |
0x77 = 01110111


In each column where there is a 1 in either value you get a 1 in the result.

Now if you shift the first number 8 bits to the left, you end up with:

0x3700 = 0011011100000000 
0x0042 =         01000010 
------------------------- |
0x3742 = 0011011101000010


You do this when a 16-bit value has been split into two 8-bit values and you want to join them back together again into the original 16-bit value.