Skip to content

Secondary functions

Bendeguz-Cs edited this page Mar 3, 2025 · 2 revisions

Important

This page is mainly for developers, find the core features on the Home page

Functions

getMotion()

getDirection()

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());

Encoder.getDirection()

Description

Returns 1 for CW rotation, -1 for CCW rotation

Parameters

none

Example

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

Clone this wiki locally