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 authored and Stephen Stack committed Mar 27, 2017
1 parent aa27a92 commit 7f26c1a
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 7f26c1a

Please sign in to comment.