Complete the code to start an I2C transmission to device address 0x50.
I2C_Start();
I2C_Write([1]);The device address must be shifted left by 1 bit to make room for the read/write bit in I2C communication.
Complete the code to write the data byte 0x3F to the I2C device.
I2C_Write([1]);0x3F is the data byte we want to send to the device.
Fix the error in the code to properly stop the I2C transmission.
I2C_Stop[1];I2C_Stop is a function and must be called with parentheses.
Fill all three blanks to write a byte 0x7A to register 0x10 of the I2C device at address 0x60.
I2C_Start(); I2C_Write([1]); I2C_Write([2]); I2C_Write([3]);
First, send the device address shifted left for writing, then send the register address, then the data byte 0x7A.
Fill all three blanks to complete the function that writes a data byte to a register of an I2C device.
void writeRegister(uint8_t deviceAddr, uint8_t regAddr, uint8_t data) {
I2C_Start();
I2C_Write([1]);
I2C_Write([2]);
I2C_Write([3]);
I2C_Stop();
}The function sends the device address shifted left, then the register address, then the data byte.