1. angle sensor [index] rotated angle(°)

Angle Sensor - 图1

Reports the angle the specified angle sensor rotates

How to Use

The number in this block indicates the place of an angle sensor among the ones connected to Halocode. As shown in the following figure, the number 1 indicates the first angle sensor connected to Halocode, 2 indicates the second one, and so on.
Angle Sensor - 图2
The following figure shows the relation between the rotation direction and angle.

Angle Sensor - 图3

When you rotate the angle sensor clockwise, the angle increases; and when you rotate it anticlockwise, the angle decreases.
Angle precision: ±1 degree
You can select the check box on the left of this block to see the angle the angle sensor rotates on the stage.
Note: This is a reporter block that must be used in combination with another block requiring data.

Example

Angle Sensor - 图4

When you press the space key, the first LED matrix connected to Halocode displays the angle the first angle sensor rotates.
Note: Ensure that you have connected an LED matrix to Halocode.


2. angle sensor[index] resets rotated angle

Angle Sensor - 图5

Resets the angle the angle sensor rotates to zero

How to Use

The angle sensor can be rotated and detect the angle it rotates. You can use this block to reset the angle it detects to zero.

Example

Angle Sensor - 图6

Press the space key and rotate the first angle sensor connected to Halocode clockwise. The first LED matrix displays the angle the angle sensor rotates. The angle keeping increasing when you rotate the angle sensor and is reset to zero when the angle is greater than 360 degrees.
Note: Ensure that you have connected an LED matrix to Halocode.


3. angle sensor[index] angular velocity (°/s)

Angle Sensor - 图7

Reports the angular velocity at which the specified angle sensor rotates

How to Use

You can select the check box on the left of this block to see the angular velocity at which the angle sensor rotates on the stage.
Note: This is a reporter block that must be used in combination with another block requiring data.

Example

Angle Sensor - 图8

Press the space key and rotate the first angle sensor connected to Halocode. The first LED matrix displays the angular velocity the angle sensor rotates.
Note: Ensure that you have connected an LED matrix to Halocode.


4. angle sensor[index] [dir] is rotating?

Angle Sensor - 图9

Determines whether the angle sensor rotates in the specified direction

How to Use

Click to select a direction from the drop-down list box.
This is a Boolean block that contains a condition. Use it in combination with another block that requires a condition.

Example

Angle Sensor - 图10

Press the space key and rotate the first angle sensor connected to Halocode. All the LEDs on Halocode are lit up in red. When you stop rotating the angle sensor, all the LEDs are turned off.