Skip to content

Commit

Permalink
Define constructor on cpp file
Browse files Browse the repository at this point in the history
  • Loading branch information
asukiaaa committed Oct 31, 2020
1 parent 0745af4 commit d0d5cf0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 10 additions & 0 deletions src/MPU9250_asukiaaa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ uint8_t MPU9250_asukiaaa::i2cWriteByte(uint8_t Address, uint8_t Register, uint8_
return myWire->endTransmission();
}

MPU9250_asukiaaa::MPU9250_asukiaaa(uint8_t address):
address(address) {
accelRange = 0;
gyroRange = 0;
magXOffset = 0;
magYOffset = 0;
magZOffset = 0;
myWire = NULL;
}

void MPU9250_asukiaaa::setWire(TwoWire* wire) {
myWire = wire;
}
Expand Down
10 changes: 1 addition & 9 deletions src/MPU9250_asukiaaa.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,7 @@ class MPU9250_asukiaaa {
uint8_t gyroBuff[MPU9250_BUFF_LEN_GYRO];
uint8_t magBuff[MPU9250_BUFF_LEN_MAG];

MPU9250_asukiaaa(uint8_t address = MPU9250_ADDRESS_AD0_LOW) {
this->address = address;
accelRange = 0;
gyroRange = 0;
magXOffset = 0;
magYOffset = 0;
magZOffset = 0;
myWire = NULL;
}
MPU9250_asukiaaa(uint8_t address = MPU9250_ADDRESS_AD0_LOW);
void setWire(TwoWire *wire);
uint8_t readId(uint8_t *id);

Expand Down

0 comments on commit d0d5cf0

Please sign in to comment.