I²C protocol - Understanding
The code in your example is "clocking in" or "shifting in" a byte using a serial protocol. On every pulse of the clock line, your program reads in the next bit from a data line.

Here's another way to write your code which may be clearer, assuming that your program is the master (ie. in charge of generating the clock line). The purpose of this code is to clock out a square wave on CLK and to sample SDA at the centre of each high CLK pulse. Each of the samples are shifted into incoming_byte a bit at a time.

The diagram below shows the byte 0x47 as it might appear on the SDA line. Notice how the bit pattern is built up by shifting and ORing the data into a byte variable, assume that SDA can only be 0 or 1 for the illustration.



uint8_t incoming_byte = 0x00;

for (i=0; i&lt;8; i++)
{
  delay(1);
  CLK=1;
  delay(1);
  incoming_byte &lt;&lt;= 1;
  incoming_byte |= SDA;
  delay(1);
  CLK=0;
  delay(1);
}

printf("%02X", incoming_byte);