Skip to content

Commit 2ec9b94

Browse files
bigdinotechsys_maker
authored and
sys_maker
committed
Update Wire examples to use Serial instead of Serial1
-change Serial to Serial1 in the master_writer and master_reader examples
1 parent 5f3ee5b commit 2ec9b94

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

libraries/Wire/examples/master_reader/master_reader.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
void setup()
1616
{
1717
Wire.begin(); // join i2c bus (address optional for master)
18-
Serial1.begin(9600); // start serial for output
18+
Serial.begin(9600); // start serial for output
1919
}
2020

2121
void loop()
@@ -25,8 +25,8 @@ void loop()
2525
while (Wire.available()) // slave may send less than requested
2626
{
2727
char c = Wire.read(); // receive a byte as character
28-
Serial1.print(c); // print the character
29-
Serial1.println();
28+
Serial.print(c); // print the character
29+
Serial.println();
3030

3131
}
3232

libraries/Wire/examples/master_writer/master_writer.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
void setup()
1616
{
1717
Wire.begin(); // join i2c bus (address optional for master)
18-
Serial1.begin(9600);
18+
Serial.begin(9600);
1919
}
2020

2121
byte x = 1;
@@ -26,9 +26,9 @@ void loop()
2626
//Wire.write("x is "); // sends five bytes
2727
Wire.write(x); // sends one byte
2828
int result = Wire.endTransmission(); // stop transmitting
29-
Serial1.println();
30-
Serial1.print("x = ");
31-
Serial1.print(x);
29+
Serial.println();
30+
Serial.print("x = ");
31+
Serial.print(x);
3232
x++;
3333
delay(500);
3434
}

0 commit comments

Comments
 (0)