Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed May 10, 2024
1 parent 3217457 commit d6ba290
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions GY521.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,13 @@ bool GY521::setDLPFMode(uint8_t mode)
{
if (mode > 6)
{
_error = GY521_ERROR_PARAMETER;
return false;
}
uint8_t val = getRegister(GY521_CONFIG);
val &= 0xF8;
val |= mode;
return true;
uint8_t value = getRegister(GY521_CONFIG);
value &= 0xF8;
value |= mode;
return (setRegister(GY521_CONFIG, value) == GY521_OK);
}


Expand Down
1 change: 1 addition & 0 deletions GY521.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const float GRAVITY = 9.80655;
#define GY521_ERROR_READ -1
#define GY521_ERROR_WRITE -2
#define GY521_ERROR_NOT_CONNECTED -3
#define GY521_ERROR_PARAMETER -4


// CONVERSION CONSTANTS
Expand Down

0 comments on commit d6ba290

Please sign in to comment.