Syntax
class TwoWire : public Stream;
ContentsIndex
PreviousUpNext
TwoWire Class
Members
Syntax
class TwoWire : public Stream;
Description

TwoWire class interface enables LinkIt ONE to connect to other devices through I2C/TWI bus. It occupies pin D18 (SDA) as the serial data wire and pin D19 (SCL) as the serial clock wire.

Class Hierarchy
File

Wire.h

Group
Methods
Method 
Description 
Returns the number of bytes the read() function can read
Sets up the host address for I2C communication. LinkIt ONE supports void TwoWire:begin(void), which means the I2C bus is joined as a host. To use the Wire library, under normal conditions, this function must be called and called only once. 
Enables the communication with the slave at an assigned address. After that, the data are written by using write()and transmitted by using endTransmission(). 
Enables the communication with the slave at an assigned address. After that, the data are written by using write() and transmitted by using endTransmission(). 
Ends the communication with the slave assigned by beginTransmission() and transmits the data buffered by write() to the slave. 
read 
Reads a byte of data which are sent from master to slave or from slave to master. The master makes requests by using requestFrom(). 
Enables a master to request data from a slave and get data by using available() and read()functions. 
Enables a master to request data from a slave and get data by using available() and read()functions. 
This function writes data into the queue and is called between functions beginTransmission()and endTransmission().