Complete the code to import the smbus2 library.
from smbus2 import [1]
The SMBus class is imported from the smbus2 library to communicate over I2C.
Complete the code to create an SMBus object for I2C bus number 1.
bus = [1](1)
The SMBus(1) creates an object for I2C bus number 1 on Raspberry Pi.
Fix the error in the code to write a byte value 0x10 to device address 0x20 at register 0x01.
bus.write_byte_data([1], 0x01, 0x10)
The first argument to write_byte_data is the device address, which is 0x20 here.
Fill both blanks to read a byte from register 0x05 of device address 0x30.
data = bus.[1]([2], 0x05)
Use read_byte_data method with device address 0x30 to read from register 0x05.
Fill all three blanks to write a block of data [0x01, 0x02, 0x03] to register 0x10 of device address 0x40.
bus.[1]([2], 0x10, [3])
Use write_i2c_block_data with device address 0x40 and the data list to write multiple bytes to register 0x10.
