Triport#

Initializing the Triport Class#

A Triport, or 3-Wire Expander, is created by using the following constructor:

Triport(port)

This constructor only uses one parameter:

Parameter

Description

port

The port the 3-Wire Expander is connected to on the EXP Brain.

# Construct a Triport object named expander_1 in Port 1.
expander_1 = Triport(Ports.PORT1)

This expander_1 object will be used in all subsequent examples throughout this API documentation when referring to Triport class methods.

Triports also have a letter attribute denoting the specific port in use. Each port is identified by a letter (a through h) and can be accessed using the format expander_1.x, where x is the port letter. For example, expander_1.a refers to the Sensor connected to the Triport’s port A.

Class Methods#

index()#

The index() method returns the index of the Triport.

Returns: The index of the Triport.

installed()#

The installed() method checks if the Triport is connected.

Returns: True if the Triport is connected. False if it not.

timestamp()#

The timestamp() method returns the timestamp of the last received message from the Triport’s sensor.

Returns: The timestamp of the last received message from the Triport’s sensor in milliseconds.