三港#
为了使三端口命令在 VEXcode V5 中可用,必须在设备窗口中配置 3 线扩展器。
有关详细信息,请参阅以下文章:
初始化三端口类#
Triport 或 3 线扩展器是使用以下构造函数创建的:
The triport
constructor creates a triport object.
范围 |
描述 |
---|---|
|
3 线扩展器连接到 V5 Brain 上的 端口。 |
// Construct a 3-Wire Expander "Triport1" with the triport class.
triport Triport1 = triport(PORT1);
This Triport1
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 Triport1.x
, where x
is the port letter. For example, Triport1.a
refers to the Sensor connected to the Triport’s port A.
类方法#
installed()#
The installed()
command returns the status of what is installed on the port.
Returns: true
if a 3-Wire Port device is installed in the port. false
if one is not.