Skip to content

Commit

Permalink
AP_DAC: apply unity gain
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Mar 16, 2024
1 parent 793ce62 commit 1b9ddfb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libraries/AP_DAC/AP_DAC_DACx0501.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@ void AP_DAC_DACx0501::init()
return;
}

_dev->set_retries(10);
// Set gain to unity
uint8_t buf[3];
buf[0] = DACx0501_REG_GAIN;
buf[1] = 0;
buf[2] = 0;
UNUSED_RESULT(_dev->transfer(buf, sizeof(buf), nullptr, 0));
_dev->set_retries(3);

_dev->register_periodic_callback(20 * 1000, FUNCTOR_BIND_MEMBER(&AP_DAC_DACx0501::thread, void));
}

Expand Down

0 comments on commit 1b9ddfb

Please sign in to comment.