Skip to content

Commit

Permalink
Merge pull request #4 from PaulStoffregen/master
Browse files Browse the repository at this point in the history
Compatibility with 32 bit boards
  • Loading branch information
elizabethsrobert authored Nov 29, 2016
2 parents a5ca826 + 9f8b2c7 commit 2cf01ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ author=SparkFun Electronics
maintainer=SparkFun Electronics
sentence=An Arduino library for interfacing with the SparkFun Triple Axis Accelerometer Breakout - ADXL345
paragraph=An Arduino library for interfacing with the SparkFun Triple Axis Accelerometer Breakout - ADXL345
category=sensors
category=Sensors
url=https://github.com/sparkfun/SparkFun_ADXL345_Arduino_Library
architectures=*
8 changes: 4 additions & 4 deletions src/SparkFun_ADXL345.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ void ADXL345::readAccel(int *x, int *y, int *z) {
readFrom(ADXL345_DATAX0, ADXL345_TO_READ, _buff); // Read Accel Data from ADXL345

// Each Axis @ All g Ranges: 10 Bit Resolution (2 Bytes)
*x = (((int)_buff[1]) << 8) | _buff[0];
*y = (((int)_buff[3]) << 8) | _buff[2];
*z = (((int)_buff[5]) << 8) | _buff[4];
*x = (int16_t)((((int)_buff[1]) << 8) | _buff[0]);
*y = (int16_t)((((int)_buff[3]) << 8) | _buff[2]);
*z = (int16_t)((((int)_buff[5]) << 8) | _buff[4]);
}

void ADXL345::get_Gxyz(double *xyz){
Expand Down Expand Up @@ -818,4 +818,4 @@ void print_byte(byte val){
for(i=7; i>=0; i--){
Serial.print(val >> i & 1, BIN);
}
}
}

0 comments on commit 2cf01ae

Please sign in to comment.