There is this chunk code where i do not understand.
This is a i2C code based on master request program.
sendCommand (read_A0, 2); val = Wire.read (); val <<= 8; val |= Wire.read (); Serial.print ("Value of A0: "); Serial.println (val, DEC);
Correct me if i’m wrong, for val <<= 8; i know that it is because i2c send bit by bit. So this is to rotate the next bit for sending.
However what does val = Wire.read (); do/how does it work?
Also, for val |= Wire.read (); will apply ‘or’ on the Wire.read() value, but why does it do that, what for?