Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

I want to make a redstone device that prevents an input from turning on, then off, then on again very rapidly. For example, if a player turns a lever on, it should update instantly. However, if they turn it off, then turn it on again, the machine should stay off for a few moments before it turns back on. To put it another way, there should be a forced minimum delay between turning a device off then on, but no delay between turning the device on then off. Also, if the user turns the device off, waits the delay, then turns it on, the device should update instantaneously.

I have tried various approaches to this problem, and I assume I will have to use some kind of RS NOR Latch in combination with a series of repeaters for the delay, but I can't get it to function quite right. What's the best way to do this?

share|improve this question
    
Just thinking through what would be needed, I can see this circuit getting fairly large. –  MBraedley May 20 '12 at 23:43

2 Answers 2

up vote 3 down vote accepted

I managed to figure this one out. Here's a picture of the finished design:

Here's another picture of the same model:

Both of these images come from a compressed version of the device, but it's difficult to tell what's going on. Here's a much less compact version which is easier to understand. Keep in mind that the components are still the same in this version, just more spread out.

Here are the various components:

  • Red is the input.
  • Blue is a standard AND Gate.
  • Yellow is a falling edge trigger.
  • Green is simply a delay circuit.
  • Orange is a piston T Flip-Flop, as seen here in design M.
  • Purple is the output.

This works by using the T Flip-Flop as a "lock" to stop the input from going through the AND gate. The falling edge trigger creates a pulse when the AND Gate goes from ON to OFF, toggling the T Flip-Flop. The delay circuit then toggles the T Flip-Flop again, reopening the AND Gate.

The design can be fairly compact, but is a little slow. If speed is an issue, you could definitely speed it up by doing these things:

  1. Change the T Flip-Flop to an RS NOR Latch.
  2. Bypass the AND Gate when handling the input with the RS NOR Latch.
  3. Remove as many torches in the design as possible by using an inverted latch.

If speed is an issue and you can't figure out those modifications, I can try and add them to my design and post it. Just leave a comment. In my case, speed was not an issue, so I used this design instead. Take your pick.

share|improve this answer
    
Nice, I eventually ended up with a similar solution. –  gnovice May 21 '12 at 4:57

After playing with this a bit I ended up with a design similar to Jake King's, except that I used an RS NOR latch instead of a T flip-flop. Here's a screen shot:

enter image description here

The components are:

  • AND gate (red), receives the switch input from the lower left.
  • Falling-edge detector (yellow), with the circuit output exiting on the left.
  • Delay circuit (green) using repeaters.
  • RS NOR latch (blue), with the S input on the left (yellow), the R input on the right (green), and the inverted Q output connected to the AND gate (red).

With this setup, the state of the RS NOR latch output will be toggled into the OFF state for an amount of time equal to your repeater delay whenever the circuit output shuts off, thus creating a fixed delay before the AND gate is able to produce an ON output.

share|improve this answer
    
Nice, I later implemented an RS NOR Latch version into my model. It's smaller horizontally, but it's taller. This is certainly helpful. Thanks! –  Alexis King May 22 '12 at 0:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.