Engee documentation

Arduino-encoderRead

The block is supported on STM32 boards.

Output of the number of ticks of the quadrature encoder.

blockType: CFunction

Path in the library:

/Interfaces/Targets/Arduino/Arduino-encoderRead

Description

To work with the block, install/update the support package. equipment.

Block Arduino-encoderRead outputs the number of ticks (pulses) of a quadrature encoder on a rotating motor connected to the board.

Ports

Output

# value — the number of ticks relative to the initial position
scalar

Details
Data types

Int32

Complex numbers support

No

Parameters

Main group

# Первый номер канала таймера — pin of the card on which the encoder signal A is output

Details
Default value

:A0

Program usage name

m_pinA

Tunable

No

Evaluatable

Yes

# Второй номер канала таймера — pin of the board on which the encoder signal B is output

Details
Default value

:A1

Program usage name

m_pinB

Tunable

No

Evaluatable

Yes

# Число тиков за оборот — the number of ticks per full rotation of the encoder

Details

The number of ticks per full rotation of the encoder with the initial position 0. Clockwise rotation will increase the output signal of the unit by 1 before T/2 (when rotating by half of a full turn), counterclockwise rotation will reduce the output signal of the unit by 1 before −T/2 (when turning half of a full turn).

Default value

100

Program usage name

m_ticks

Tunable

No

Evaluatable

Yes

# Размер шага — the period from which the block will be called

Details

Specify the interval between the calculation steps as a non-negative number. To inherit the calculation step, set this parameter to −1.

Default value

-1

Program usage name

m_sampletime

Tunable

No

Evaluatable

Yes