Add parentheses to force correct addition operation. Thanks to Barry Halterman for catching this.

This commit is contained in:
reedbn 2020-12-13 11:42:38 -08:00
parent a4f5f4b3cb
commit b136f5e43c
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ static const uint8_t MOMENTUM_MULTIPLIER = 1;
uint8_t enc_state (void)
{
return (digitalRead(PIN_ENC_A)?1:0 + digitalRead(PIN_ENC_B)?2:0);
return ((digitalRead(PIN_ENC_A)?1:0) + (digitalRead(PIN_ENC_B)?2:0));
}
/*