Skip to content

DEPRECATED

Bendeguz edited this page May 27, 2026 · 5 revisions

Important

These functions are no longer supported and will not be included in future updates

Functions

getMotion()

getDirection()

limitedRead()

Encoder.getMotion()

Description

Returns true if the encoder is moving, if t's not then it will return false

Parameters

none

Example

//prints a 1 to the serial monitor if the encoder is moving, else it prints 0
Serial.println(encoder.getMotion());

Note

This function was removed in version 2.0.0

Note

This function is available in a similar way as encoder.motion()

Encoder.getDirection()

Description

Returns 1 for CW rotation, -1 for CCW rotation

Parameters

none

Example

//
Serial.println(encoder.getDirection());

Note

This function was removed in version 2.0.0

Note

This function is being reintroduced under the same name but DIFFERENT FUNCTION in 2.5.0 You can access the documentation here

Encoder.limitedRead()

Description

Returns an integer that can be changed by the rotary encoder but can be given a lower and an upper limit.

Parameters

  • int Minval - lower stop

  • int Maxval - upper stop

Example

//Returns the value constrained between 0 and 10
encoder.limitedRead(0, 10);

Note

The replacement function for this is setLimits()

Clone this wiki locally