1. button [index] pressed?

Button - 图1

Determines whether the specified button is pressed

How to Use

A button module can be used to trigger an event, change a state, or start/stop counting.
The number in this block indicates the place of a button among the ones connected to Halocode. As shown in the following
figure, the number 1 indicates the first button connected to Halocode, 2 indicates the second one, and so on.
Button - 图2

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

Example

Button - 图3

When you press the space key, the LED matrix displays the count value of the timer. After you press the button, the timer is reset and counts counts from zero again.
Note: Ensure that you have connected an LED matrix to Halocode.


2. button[index] number of times button being pressed

Button - 图4

Reports the number of times the specified button is pressed

How to Use

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

Example

Button - 图5

Press the space key and press the button. The LED maxtrix displays the number of times the button is pressed.
Note: Ensure that you have connected an LED matrix to Halocode.


3. button [index] resets counts

Button - 图6

Resets the number of times the specified button is pressed to zero

How to Use

Click to select the button from the drop-down list box.

Example

Button - 图7

Press the space key and press the button. The LED displays the number of times the button is pressed. 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.