Wiki 9Minecraft Wiki 9Minecraft
Project Red Integration Wiki › Guides › How to Use the Counter and State Cell for Sequential Logic

How to Use the Counter and State Cell for Sequential Logic

Counting Pulses with the Counter

The Counter increments each time it receives a redstone pulse on its input. Right-click it to open the interface and set the maximum count. When the count reaches that value, the Counter emits an output signal and can be configured to reset. Use it to trigger something after a set number of events — for example, opening a door after five button presses. Wire your pulse source into the input and the output to your target device.

Holding State with the State Cell

A State Cell remembers whether it is on or off and holds that state until changed. It has separate inputs for setting and resetting, plus an output. Feed a pulse into the set input to turn it on; the output stays high until a pulse hits the reset input. This makes it ideal for latching a momentary button press into a sustained signal, such as keeping a machine running until a sensor says stop.

Combining Them

Chain a Counter's output into a State Cell's set input so that after a set number of pulses the State Cell latches on and stays on. Use a separate reset line — perhaps from a Toggle Latch or a manual button — to clear both. Test each block individually with lamps before combining them.