You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is related to a bad conversion, when you try to do a left shit of 16-bit, this will lead to an overflow, and the result will be zero, this means that the number is considered an integer, CLanguage should be able to convert this shift to a long value and don't return a zero, this happens in Arduino
bytepressure_data_high=readRegister(0x1F, 1);
pressure_data_high &= 0b00000111; //you only needs bits 2 to 0//Read the pressure data lower 16 bits:unsigned intpressure_data_low=readRegister(0x20, 2);
//combine the two parts into one 19-bit number:longpressure= ((pressure_data_high << 16) | pressure_data_low) / 4;
The text was updated successfully, but these errors were encountered:
This issue is related to a bad conversion, when you try to do a left shit of 16-bit, this will lead to an overflow, and the result will be zero, this means that the number is considered an integer, CLanguage should be able to convert this shift to a long value and don't return a zero, this happens in Arduino
The text was updated successfully, but these errors were encountered: