2
// by Nicholas Zambetti <http://www.zambetti.com>
4
// Demonstrates use of the Wire library
5
// Reads data from an I2C/TWI slave device
6
// Refer to the "Wire Slave Sender" example for use with this
8
// Created 29 March 2006
10
// This example code is in the public domain.
17
Wire.begin(); // join i2c bus (address optional for master)
18
Serial.begin(9600); // start serial for output
23
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
25
while(Wire.available()) // slave may send less than requested
27
char c = Wire.read(); // receive a byte as character
28
Serial.print(c); // print the character