Skip to content

Modification of casting for LSB and MSB for X, Y, and Z data readings #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/SparkFun_TMAG5273_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2527,8 +2527,8 @@ float TMAG5273::getTemp()
/// @return X-Channel data conversion results
float TMAG5273::getXData()
{
int8_t xLSB = readRegister(TMAG5273_REG_X_LSB_RESULT);
int8_t xMSB = readRegister(TMAG5273_REG_X_MSB_RESULT);
uint8_t xLSB = readRegister(TMAG5273_REG_X_LSB_RESULT);
uint8_t xMSB = readRegister(TMAG5273_REG_X_MSB_RESULT);

// Variable to store full X data
int16_t xData = 0;
Expand Down Expand Up @@ -2560,8 +2560,8 @@ float TMAG5273::getXData()
/// @return Y-Channel data conversion results
float TMAG5273::getYData()
{
int8_t yLSB = 0;
int8_t yMSB = 0;
uint8_t yLSB = 0;
uint8_t yMSB = 0;

yLSB = readRegister(TMAG5273_REG_Y_LSB_RESULT);
yMSB = readRegister(TMAG5273_REG_Y_MSB_RESULT);
Expand Down Expand Up @@ -2596,8 +2596,8 @@ float TMAG5273::getYData()
/// @return Z-Channel data conversion results.
float TMAG5273::getZData()
{
int8_t zLSB = 0;
int8_t zMSB = 0;
uint8_t zLSB = 0;
uint8_t zMSB = 0;

zLSB = readRegister(TMAG5273_REG_Z_LSB_RESULT);
zMSB = readRegister(TMAG5273_REG_Z_MSB_RESULT);
Expand Down