1. motion sensor [index] [dir] ?
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.
Click to select a motion sensor and its state. The following figure shows the states of a motion sensor.
Note: This is a Boolean block that contains a condition. Use it in combination with another block that requires a condition.
Example
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?
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
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
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
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 (°)
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.
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
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 (°)
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.
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
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]
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.
Example
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.