Save 12 bytes by adjusting math, inspried by Jack Purdum
This commit is contained in:
parent
4eecda170d
commit
4918670eaa
@ -16,7 +16,7 @@ static const uint8_t MOMENTUM_MULTIPLIER = 1;
|
|||||||
|
|
||||||
uint8_t enc_state (void)
|
uint8_t enc_state (void)
|
||||||
{
|
{
|
||||||
return ((digitalRead(PIN_ENC_A)?1:0) + (digitalRead(PIN_ENC_B)?2:0));
|
return (digitalRead(PIN_ENC_B) << 1) + (digitalRead(PIN_ENC_A) << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user