Skip to content

Commit

Permalink
Make faderbank i2c values independent of voltage range
Browse files Browse the repository at this point in the history
  • Loading branch information
Dewb committed Sep 25, 2023
1 parent f930ad7 commit 67a1e79
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/common/core/IIBus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ void IIBus::step()
{
for (uint8_t fader = 0; fader < std::min(16, followers[follower]->getNumParams()); fader++)
{
float voltage = followers[follower]->params[fader].getValue();
uint16_t value = static_cast<uint16_t>(voltage / 10.0 * FADERBANK_II_MAX_VALUE);
leader->firmware.iiUpdateFollowerData(follower + 0x34, fader, value);
auto param = followers[follower]->getParamQuantity(fader);
if (param)
{
uint16_t value = static_cast<uint16_t>(param->getScaledValue() * FADERBANK_II_MAX_VALUE);
leader->firmware.iiUpdateFollowerData(follower + 0x34, fader, value);
}
}
}
}

0 comments on commit 67a1e79

Please sign in to comment.