Skip to content

Commit dd88644

Browse files
committed
Merge pull request #3109 from agdl/fix_i2cexamples
Fix for #2969 (I2C reserved addresses)
2 parents 2e90af7 + 9a9760c commit dd88644

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

libraries/Wire/examples/master_reader/master_reader.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void setup()
2020

2121
void loop()
2222
{
23-
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
23+
Wire.requestFrom(8, 6); // request 6 bytes from slave device #8
2424

2525
while (Wire.available()) // slave may send less than requested
2626
{

libraries/Wire/examples/master_writer/master_writer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ byte x = 0;
2121

2222
void loop()
2323
{
24-
Wire.beginTransmission(4); // transmit to device #4
24+
Wire.beginTransmission(8); // transmit to device #8
2525
Wire.write("x is "); // sends five bytes
2626
Wire.write(x); // sends one byte
2727
Wire.endTransmission(); // stop transmitting

libraries/Wire/examples/slave_receiver/slave_receiver.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
void setup()
1616
{
17-
Wire.begin(4); // join i2c bus with address #4
17+
Wire.begin(8); // join i2c bus with address #8
1818
Wire.onReceive(receiveEvent); // register event
1919
Serial.begin(9600); // start serial for output
2020
}

libraries/Wire/examples/slave_sender/slave_sender.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
void setup()
1616
{
17-
Wire.begin(2); // join i2c bus with address #2
17+
Wire.begin(8); // join i2c bus with address #8
1818
Wire.onRequest(requestEvent); // register event
1919
}
2020

0 commit comments

Comments
 (0)