#

初始化大脑类#

Brain 是使用以下构造函数创建的:

brain

此构造函数不使用任何参数。

// Create a new object "Brain" with the brain class.
brain Brain;

This Brain object will be used in all subsequent examples throughout this API documentation when referring to brain class methods and attributes.

大脑类有六个预定义属性:

  • Battery - 提供有关 V5 Brain 电池的信息,包括容量、温度、电压和电流。

  • Timer - 提供测量经过时间的功能并为 V5 Brain 上基于时间的事件分配函数。

  • Screen - 使您能够在 V5 Brain 的屏幕上显示文本、绘制形状和分配触摸响应功能。

  • SDcard - 提供对存储在 V5 Brain 的 SD 卡上的文件的访问。

  • ThreeWirePort - Provides access to 3-Wire Sensors connected to the V5 Brain’s 3-Wire Ports. Each port is identified by a letter (a through h) and can be accessed using the format brain.ThreeWirePort.X, where X is the port letter. For example, brain.ThreeWirePort.A refers to the Sensor connected to port A.

类方法#

除了属性之外,Brain类还提供了可以直接使用的方法。

程序停止()#

The programStop() method stops the currently running project.

**返回:**无。