So I am decided to get a Arduino to learnlearning about I2C on the Arduino. I was looking at a sample program to scan for I2C devices and saw this.:
// This sketch tests the standard 7-bit addresses
// from 0 to 127. Devices with higher bit address
// might not be seen properly.
With the following code.
for(address = 0; address <= 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
}
}
As far as I understand it, a bit is just 1. So, so why if it'show do 7 bits does it loop from 0 - 127?
A realize this is a probably total newbie question but keep in mind I know nothing about this stuff so I wouldn't even know where to look to understand what that means...
thanks!