aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorArturo Guadalupi <a.guadalupi@arduino.cc>2015-05-07 17:41:18 +0200
committerArturo Guadalupi <a.guadalupi@arduino.cc>2015-05-14 11:27:00 +0200
commit9a9760cc86e1684875e5fdb2f39e146042df9f72 (patch)
treedcbbe996d93c958568603db25c4c60011cb14495 /libraries
parentb682456e8e74dbbccb3e709b7838a8475902c00c (diff)
Fixes #2969:
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.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/Wire/examples/master_reader/master_reader.ino2
-rw-r--r--libraries/Wire/examples/master_writer/master_writer.ino2
-rw-r--r--libraries/Wire/examples/slave_receiver/slave_receiver.ino2
-rw-r--r--libraries/Wire/examples/slave_sender/slave_sender.ino2
4 files changed, 4 insertions, 4 deletions
diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino
index 74f0155..2d2419b 100644
--- a/libraries/Wire/examples/master_reader/master_reader.ino
+++ b/libraries/Wire/examples/master_reader/master_reader.ino
@@ -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
{
diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino
index 482e922..9933cc2 100644
--- a/libraries/Wire/examples/master_writer/master_writer.ino
+++ b/libraries/Wire/examples/master_writer/master_writer.ino
@@ -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
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 15eff9a..53df274 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -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
}
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index 4437ab1..26b9e52 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -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
}