Skip to content

Commit

Permalink
improvement: using specific range messages over writing to registers
Browse files Browse the repository at this point in the history
  • Loading branch information
Karel Kalthoff committed Mar 24, 2017
1 parent 5668926 commit 54f22bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hardware/bean/avr/cores/bean/Bean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,14 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) {

uint8_t BeanClass::getAccelerationRange(void) {
uint8_t value;
Serial.accelRegisterRead(REG_G_SETTING, 1, &value);
//Serial.accelRegisterRead(REG_G_SETTING, 1, &value);
Serial.accelRangeRead(&value);
return value;
}

void BeanClass::setAccelerationRange(uint8_t range) {
Serial.accelRegisterWrite(REG_G_SETTING, range);
//Serial.accelRegisterWrite(REG_G_SETTING, range);
Serial.accelRangeSet(&range);
}

int16_t BeanClass::getAccelerationX(void) {
Expand Down

0 comments on commit 54f22bf

Please sign in to comment.