1. motion sensor [index] [dir] ?

Motion Sensor - 图1

Determines whether the specified motion sensor is in the specified state

How to Use

The number in this block indicates the place of a motion sensor among the ones connected to Halocode. As shown in the following figure, the number 1 indicates the first motion sensor connected to Halocode, 2 indicates the second one, and so on.
Motion Sensor - 图2
Click to select a motion sensor and its state. The following figure shows the states of a motion sensor.
Motion Sensor - 图3
Note: This is a Boolean block that contains a condition. Use it in combination with another block that requires a condition.

Example

Motion Sensor - 图4

Press the space key, and tilt the first motion sensor connected to Halocode backward. All the LEDs on Halocode are lit up in red. Change the state of the motion sensor. All the LEDs are turned off.


2. motion sensor [index]detects[strength] shaking?

Motion Sensor - 图5

Determines whether the motion sensor detects shaking of the specified intensity

How to Use

Click to select a motion sensor and the shaking intensity.
Note: This is a Boolean block that contains a condition. Use it in combination with another block that requires a condition.

Example

Motion Sensor - 图6

Press the space key and shake the first motion sensor connected Halocode slightly. All the LEDs on Halocode are lit up in red. Stop shaking the motion sensor. All the LEDs are turned off.


3. motion sensor [index] shaking strength

Motion Sensor - 图7

Reports the shaking intensity detected by the specified motion sensor

How to Use

A greater value indicates the more intense shaking.
You can select the check box on the left of this block to see the shaking intensity detected by the motion sensor on the stage.
Note: This is a reporter block that must be used in combination with another block requiring data.

Example

Motion Sensor - 图8

Press the space key and shake the first motion sensor connected to Halocode. The first LED matrix displays the shaking intensity, which changes with the force you use to shake the motion sensor.
Note: Ensure that you have connected an LED matrix to Halocode.


4. motion sensor [index] [posture] posture (°)

Motion Sensor - 图9

Reports the pitch or roll angle of the specified motion sensor

How to Use

The following figure shows the definition of the pitch and roll angles.

Motion Sensor - 图10

Pitch angle range: –180° to +180°
Roll angle range: –90° to +90°
You can select the check box on the left of this block to see the pitch or roll angle on the stage.
Note: This is a reporter block that must be used in combination with another block requiring data.

Example

Motion Sensor - 图11

Press the space key and rotate the first motion sensor connected to Halocode around the x axis. The LED matrix displays the pitch angle of the motion sensor.
Note: Ensure that you have connected an LED matrix to Halocode.


5. motion sensor [index] around[axis] rotated angle (°)

Motion Sensor - 图12

Reports the angle the specified motion sensor rotates around the x, y, or z axis

How to Use

The following figure shows the axes of the motion sensor.

Motion Sensor - 图13

You can select the check box on the left of this block to see the angle the motion sensor rotates around the x, y, or z axis on the stage.
Note: This is a reporter block that must be used in combination with another block requiring data.

Example

Motion Sensor - 图14

Press the space key and rotate the first motion sensor connected to Halocode around the y axis. The LED matrix displays the angle the motion sensor rotates around the z axis.
Note: Ensure that you have connected an LED matrix to Halocode.


6. motion sensor[index] resets rotated angle around [axis]

Motion Sensor - 图15

Resets the angle the specified motion sensor rotates around the specified axis to zero

How to Use

Click to select a motion sensor and a rotation axis.
The following figure shows the axes of the motion sensor.

Motion Sensor - 图16

Example

Motion Sensor - 图17

Press the space key and rotate the first motion sensor connected to Halocode around the x axis. The LED matrix displays the angle, and the angle is reset to zero when it is greater than 360.
Note: Ensure that you have connected an LED matrix to Halocode.