This fixes the Wire examples that uses I2C reserved address (from 0 to 7) substituting them with 8 that is the first one available and that can be used.

I also modified the wire reference
http://www.arduino.cc/en/reference/wire
according to this fact.
This commit is contained in:
Arturo Guadalupi 2015-05-07 17:41:18 +02:00
parent 5bc6cee118
commit 5199b0f6d3
4 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ void setup()
void loop()
{
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
Wire.requestFrom(8, 6); // request 6 bytes from slave device #8
while (Wire.available()) // slave may send less than requested
{

View File

@ -21,7 +21,7 @@ byte x = 0;
void loop()
{
Wire.beginTransmission(4); // transmit to device #4
Wire.beginTransmission(8); // transmit to device #8
Wire.write("x is "); // sends five bytes
Wire.write(x); // sends one byte
Wire.endTransmission(); // stop transmitting

View File

@ -14,7 +14,7 @@
void setup()
{
Wire.begin(4); // join i2c bus with address #4
Wire.begin(8); // join i2c bus with address #8
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}

View File

@ -14,7 +14,7 @@
void setup()
{
Wire.begin(2); // join i2c bus with address #2
Wire.begin(8); // join i2c bus with address #8
Wire.onRequest(requestEvent); // register event
}