   return max(txCoolantMin, min(txCoolantOffset + delta, txCoolantMax));
 }
 
-uint8_t scalePower(uint8_t power) {
-  uint8_t clampedPower = max(signalPowerMin, min(power, signalPowerMax));
-  return (uint8_t) ((double)(clampedPower - signalPowerMin)/(signalPowerMax-signalPowerMin)*(txPowerMax-txPowerMin)+txPowerMin);
+float scalePowerSignalToPercentage(uint8_t powerSignal) {
+  return max(0.0f, min(100.0f, ((float)powerSignal) / 255.0f));
+}
+
+uint8_t scalePowerToTx(float powerPercentage) {
+  return (uint8_t) (powerPercentage * (txPowerMax-txPowerMin) + txPowerMin);
 }
 
 void sendMessageHeader(uint8_t messageType, uint8_t messageLength) {

void setup() {
  Serial.begin(9600);
  for (int i=0; i<8; ++i) {
    powerLevels[i] = 100;
  }
  encoders[0] = encoderSetup(53,52);
  encoders[1] = encoderSetup(51,50);

  interruptChange(&encoders[7]);
}

// Should read from analog pin and map it to [0,100]
float getPowerLevel(int sliderIndex) {
  powerLevels[sliderIndex] = powerLevels[sliderIndex] + coolantDelta[sliderIndex]*5;
  return scalePowerSignalToPercentage(powerLevels[sliderIndex]);
}

void computeCoolants() {
