Recall & Review
beginner
What is the Wire library used for in Arduino?
The Wire library is used to communicate with devices using the I2C protocol, allowing the Arduino to act as a master or slave on the I2C bus.
Click to reveal answer
beginner
How do you start the I2C communication as a master using the Wire library?
You call
Wire.begin(); in the setup() function to start the I2C bus as a master.Click to reveal answer
beginner
Which function is used to send data to a device on the I2C bus?
Use
Wire.write() to send bytes of data to the device after starting a transmission with Wire.beginTransmission(address).Click to reveal answer
beginner
How do you request data from a device using the Wire library?
Use
Wire.requestFrom(address, quantity) to ask a device for data, then read it with Wire.read().Click to reveal answer
beginner
What is the purpose of
Wire.endTransmission()?It ends the transmission to the I2C device and actually sends the data over the bus.
Click to reveal answer
Which function initializes the I2C bus as a master in Arduino?
✗ Incorrect
Wire.begin() starts the I2C bus as a master or slave depending on usage.
How do you send data to a device with address 0x3C using the Wire library?
✗ Incorrect
You start transmission with Wire.beginTransmission(address), write data, then end with Wire.endTransmission().
Which function reads a byte from the I2C device after requesting data?
✗ Incorrect
Wire.read() reads one byte from the received data buffer.
What does Wire.requestFrom(address, quantity) do?
✗ Incorrect
It asks the device to send back a specific number of bytes.
Which of these is NOT a typical step in sending data with Wire library?
✗ Incorrect
Wire.receive() is not a function in the Wire library; reading data uses Wire.read().
Explain the basic steps to send data to an I2C device using the Wire library.
Think about starting, writing, and ending the communication.
You got /3 concepts.
Describe how to read data from an I2C device using the Wire library.
Request first, then read the data.
You got /3 concepts.
