Recall & Review
beginner
What is I2C communication?
I2C (Inter-Integrated Circuit) is a simple way for devices to talk to each other using just two wires: one for data and one for clock. It lets many devices share the same wires.
Click to reveal answer
beginner
Which Python library is commonly used on Raspberry Pi to write commands to an I2C device?
The 'smbus2' library is commonly used. It helps send and receive data over I2C easily.
Click to reveal answer
intermediate
What does the 'write_byte_data' function do in I2C communication?
It sends a single byte of data to a specific register (or command) on the I2C device.
Click to reveal answer
beginner
Why do you need the device address when writing to an I2C device?
The device address tells the Raspberry Pi which device on the I2C bus should receive the command, like sending mail to the right house.
Click to reveal answer
beginner
What is the purpose of the 'bus' number in I2C communication on Raspberry Pi?
The 'bus' number selects which I2C channel on the Raspberry Pi you want to use, because some models have more than one I2C bus.
Click to reveal answer
Which two wires are used in I2C communication?
✗ Incorrect
I2C uses two wires: one for data (SDA) and one for clock (SCL).
In Python's smbus2 library, which function writes a byte to a device register?
✗ Incorrect
write_byte_data sends a single byte to a specific register on the I2C device.
What does the device address represent in I2C communication?
✗ Incorrect
The device address identifies which device on the I2C bus will receive the data.
Why might you need to specify the bus number on a Raspberry Pi?
✗ Incorrect
Some Raspberry Pi models have more than one I2C bus, so you specify which one to use.
Which Python code snippet correctly writes the value 0x10 to register 0x01 of an I2C device at address 0x20 on bus 1?
✗ Incorrect
write_byte_data(address, register, value) sends a byte to the device register.
Explain the steps to write a command to an I2C device using Python on a Raspberry Pi.
Think about setting up communication and sending data.
You got /4 concepts.
Why is it important to know the device address and bus number when writing commands to an I2C device?
Compare it to sending a letter to the right house on the right street.
You got /3 concepts.
