3 #if not defined(Encoder_h_) && not defined(IDE) 
    5     "The PJRC Encoder library should be included before the Control-Surface "  \ 
    6     "library. (#include <Encoder.h>)" 
   21 template <class Sender>
 
   26                             int16_t multiplier, uint8_t pulsesPerStep,
 
   28         : encoder{pins.
A, pins.
B}, address(address),
 
   29           multiplier(multiplier),
 
   30           pulsesPerStep(pulsesPerStep), sender(sender) {}
 
   35         long currentPosition = getValue();
 
   36         if (currentPosition != previousPosition) {
 
   37             sender.send(currentPosition, address);
 
   38             previousPosition = currentPosition;
 
   43       auto maxval = (1 << Sender::precision()) - 1;
 
   45       auto rawval = encoder.read() * multiplier / pulsesPerStep;
 
   47       auto val = constrain(rawval, 0, maxval);
 
   49         encoder.write(val * pulsesPerStep / multiplier);
 
   59     long previousPosition = 0;