but its impossible to store and transfer over I2C bus double class variables values cause i have lost of precision.
A union will solve the variable issue... take a look at how the RF12B library manages to send data over packet radio:
Example from Digispark:
union
{
unsigned char byte;
struct
{
char ATS_RSSI:
1; //ATS=Antenna tuning circuit detected strong enough RF signal
//RSSI=The strength of the incoming signal is above the pre-programmed limit
char FFEM:
1; //FIFO is empty
char LBD:
1; //Low battery detect, the power supply voltage is below the pre-programmed limit
char EXT:
1; //Logic level on interrupt pin (pin 16) changed to low (Cleared after Status Read Command)
char WKUP:
1; //Wake-up timer overflow (Cleared after Status Read Command )
char RGUR_FFOV:
1; //RGUR=TX register under run, register over write (Cleared after Status Read Command )
//FFOV=RX FIFO overflow (Cleared after Status Read Command )
char POR:
1; //Power-on reset (Cleared after Status Read Command )
char RGIT_FFIT:
1; //RGIT=TX register is ready to receive the next byte
//(Can be cleared by Transmitter Register Write Command)
//FFIT=The number of data bits in the RX FIFO has reached the pre-programmed limit
//(Can be cleared by any of the FIFO read methods)
}bits;
} status_H;
union
{
unsigned char byte;
struct
{
char OFFS:
4; //Offset value to be added to the value of the frequency control parameter (Four LSB bits)
char OFFS6:
1; //MSB of the measured frequency offset (sign of the offset value)
char ATGL:
1; //Toggling in each AFC cycle
char CRL:
1; //Clock recovery locked
char DQD:
1; //Data quality detector output
}bits;
} status_L;
Reference to example: