I'm trying to put a variable that is initially not on the I2C bus, to the I2C bus. However, my variable is of type 'float' whereas the RXData/TXData variables on the I2C bus are of type uint_8t. Do I need to convert my 'float' variable to 'uint_8t' in order to transfer this variable throughout my I2C bus and if so how can I do it? This is what I have tried so far, where writeByte is my 'float' variable and pointer is the register address I want to modify. I'm using MSP432P401R and TI's driverlib library.
/* Initiate start and send first character */ I2C_masterSendMultiByteStart(EUSCI_B0_BASE, (unsigned char)( ((writeByte>>8) & 0x0F) | ((pointer << 4) & 0x30) ) ); /* Finish transcation */ I2C_masterSendMultiByteFinish(EUSCI_B0_BASE, (unsigned char)(writeByte & 0xFF));
But I can't seem to get it working. I'd appreciate any help. Thank you in advance and have a great day.