Class «encoder»

This article is automatically translated from Russian by Google Translator.

Represents power motor encoders connected to ports E1, E2, E3, E4.

Method

Description

Returns the current encoder reading in degrees on the specified port.

Resets the current encoder reading to 0.

Returns the current encoder reading in "ticks" on the specified port.

read

Returns the current encoder reading in degrees on the specified port.

Syntax

brick.encoder(portName).read();
brick.encoder("portName").read();

As a parameter, you must specify the port.

Example

brick.encoder(E1).read();
brick.encoder("E2").read();

reset

Resets the current encoder reading to 0.

Syntax

As a parameter, you must specify the port.

Example

readRawData

Returns the current encoder reading in "ticks" on the specified port.

Syntax

Example

Last updated

Was this helpful?