1. PIR sensor [index] detects human body?

PIR Sensor - 图1

Determines whether the specified PIR sensor detects human or animal movement

How to Use

PIR sensors can detect human or animal movement.
The number in this block indicates the place of a PIR sensor among the ones connected to Halocode. As shown in the following
figure, the number 1 indicates the first PIR sensor connected to Halocode, 2 indicates the second one, and so on.

PIR Sensor - 图2

Note: This is a Boolean block that contains a condition. Use it in combination with another block that requires a condition.

Example

image.png

Press the space key and move your hand towards the PIR sensor. All the LEDs on Halocode are lit up in red. Move your hand away from the PIR sensor, the LEDs are turned off.


2. PIR sensor[index] number of times a human body detected

PIR Sensor - 图4

Reports the number of times the specified PIR sensor detects human or animal movement

How to Use

You can select the check box on the left of this block to see the number of times on the stage.
Note: This is a reporter block that must be used in combination with another block requiring data.

Example

PIR Sensor - 图5

When you press the space key, the LED matrix displays the number of times the PIR sensor detects human or animal movement. Move you hand towards the PIR sensor and then move it away over and over again. The number displayed on the LED matrix changes with your movement.
Note: Ensure that you have connected an LED matrix to Halocode.


3. PIR sensor [index] resets number of times

PIR Sensor - 图6

Resets the number of times the specified PIR sensor detects human or animal movement to zero

How to Use

Click to select the PIR sensor from the drop-down list box.

Example

PIR Sensor - 图7

When you press the space key, the LED displays the number of times the PIR sensor detects human or animal movement. When the number of times is greater than 10, the value displayed on the LED matrix is reset to zero.
Note: Ensure that you have connected an LED matrix to Halocode.