It can be a bit confusing. First there is only one byte, the address byte, not two in your statement. The I2C standard allows for up to 128 device address to be used (0-127, but 0 is a general call address) so that only requires 7 bits of a byte. The I2C standard adds the low bit to signify if the command is going to be a read or write command to the slave. To make it tricky some manufactures show their device address as a 8 bit value and some a 7 bit address. The arduino wire library only wants to have the 7 bit address sent to it as it will append the read/write bit to the end for it's internal operations.
So the 7 bit addess for that device is 1010000 (note the bottom 3 bits are changable by pin wiring, but we will assume 000) which equates to a hex 0x50, but if shown as a full 8 bit number which includes the R/W low order bit it would be a binary 10100000 or hex 0xA0. So they really are the same I2C address one with and one without the R/W bit stuck on the end. Again the wire library only wants to except the 7 bit version of the address. Again manufactures don't agree on how to define their devices I2C addresses, as a 7 or 8 bit address, so you will see it in both forms for different devices. If you see a 8 bit version just shift the byte right one bit and that is the address to use with the wire library.
By the way here is a great little I2C scanning sketch to run if you are not sure what address a device is assigned. Just wire up the device and run the sketch and it tries all 128 valid address and tells you were it got a hit. A Arduino member posted it, and it's a great little test tool to have around.
/**
* I2CScanner.pde -- I2C bus scanner for Arduino
*
* 2009, Tod E. Kurt, http://todbot.com/blog/
*
*/
#include "Wire.h"
extern "C" {
#include "utility/twi.h" // from Wire library, so we can do bus scanning
}
// Scan the I2C bus between addresses from_addr and to_addr.
// On each address, call the callback function with the address and result.
// If result==0, address was found, otherwise, address wasn't found
// (can use result to potentially get other status on the I2C bus, see twi.c)
// Assumes Wire.begin() has already been called
void scanI2CBus(byte from_addr, byte to_addr,
void(*callback)(byte address, byte result) )
{
byte rc;
byte data = 0; // not used, just an address to feed to twi_writeTo()
for( byte addr = from_addr; addr <= to_addr; addr++ ) {
rc = twi_writeTo(addr, &data, 0, 1);
callback( addr, rc );
}
}
// Called when address is found in scanI2CBus()
// Feel free to change this as needed
// (like adding I2C comm code to figure out what kind of I2C device is there)
void scanFunc( byte addr, byte result ) {
Serial.print("addr: ");
Serial.print(addr,HEX);
Serial.print( (result==0) ? " found!":" ");
Serial.print( (addr%4) ? "\t":"\n");
}
byte start_address = 1;
byte end_address = 127;
// standard Arduino setup()
void setup()
{
delay(2000);
Wire.begin();
Serial.begin(38400);
Serial.println("\nI2CScanner ready!");
Serial.print("starting scanning of I2C bus from ");
Serial.print(start_address,HEX);
Serial.print(" to ");
Serial.print(end_address,HEX);
Serial.println("...Hex");
// start the scan, will call "scanFunc()" on result from each address
scanI2CBus( start_address, end_address, scanFunc );
Serial.println("\ndone");
}
// standard Arduino loop()
void loop()
{
// Nothing to do here, so we'll just blink the built-in LED
digitalWrite(13,HIGH);
delay(300);
digitalWrite(13,LOW);
delay(300);
}
Lefty