1. MQ2 gas sensor [index]detects flammable gas at [sen]?

MQ2 Gas Sensor - 图1

Determines whether the specified MQ2 gas sensor detects flammable gas in the specified operation mode

How to Use

The number in this block indicates the place of an MQ2 gas sensor among the ones connected to Halocode. As shown in the following figure, the number 1 indicates the first MQ2 gas sensor connected to Halocode, 2 indicates the second one, and so on.
MQ2 Gas Sensor - 图2

The MQ2 gas sensor can easily detect smoke, liquefied natural gas (LNG), butane, propane, methane, alcohol, and hydrogen in the air.
Click to select an operation mode.
Note: This is a Boolean block that contains a condition. Use it in combination with another block that requires a condition.

Example

MQ2 Gas Sensor - 图3

After you press the space key, the first MQ2 gas sensor connected to Halocode starts to detect flammable gas. If it detects flammable gas, all the LEDs on Halocode are lit up in red; if it does not detect flammable gas, all the LEDs on Halocode are turned off.