Fix DAC-related bugs (#19921)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Orel
2020-10-28 03:37:10 +01:00
committed by Scott Lahteine
parent d7d1ef8228
commit f5f6170858
4 changed files with 5 additions and 5 deletions

View File

@ -124,7 +124,7 @@ uint8_t MCP4728::getDrvPct(const uint8_t channel) { return uint8_t(100.0 * dac_v
* DAC Values array and calls fastwrite to update the DAC.
*/
void MCP4728::setDrvPct(xyze_uint8_t &pct) {
dac_values *= 0.01 * pct * (DAC_STEPPER_MAX);
dac_values *= pct.asFloat() * 0.01f * (DAC_STEPPER_MAX);
fastWrite();
}