Fix DAC setDrvPct (#20205)
This commit is contained in:
@@ -123,8 +123,8 @@ uint8_t MCP4728::getDrvPct(const uint8_t channel) { return uint8_t(100.0 * dac_v
|
||||
* Receives all Drive strengths as 0-100 percent values, updates
|
||||
* DAC Values array and calls fastwrite to update the DAC.
|
||||
*/
|
||||
void MCP4728::setDrvPct(xyze_uint8_t &pct) {
|
||||
dac_values *= pct.asFloat() * 0.01f * (DAC_STEPPER_MAX);
|
||||
void MCP4728::setDrvPct(xyze_uint_t &pct) {
|
||||
dac_values = pct * (DAC_STEPPER_MAX) * 0.01f;
|
||||
fastWrite();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user