2

I want to have a series of 12 memory cells to control an analog clock I am trying to make. I have a hopper clock that triggers every 100 seconds (the equivalent of an hour in a Minecraft day) and each time it activates, if cell i is active, I want cell i+1 to activate and all others to be off. Ideally also if the cell 12 is activate and the clock triggers again, I want to deactivate 12 and activate 1 so it wraps around.

I was experimenting around with having a RS NOR latch for each memory cell, and then with each pulse of the clock, for each memory cell, I pass through the pulse and the S value into and AND gate and if true, that will trigger the next memory cell in the array to be set true and also to trigger the reset of the current memory cell.

I can't seem to get this working well though. What I have https://imgur.com/QIctUwt so far seems to be close. The torches on top of the bricks are the S values of each RS NOR gate. When the hopper click first triggers, the leftmost cell turns on. Then it triggers again, and the leftmost cell turns off and the second cell turns on. But then, as the hopper clock keeps triggering, the leftmost cell just keeps toggling on and off. I think I messed the logic up somehow.

There must be an easier way to do this, but I can't seem to think of it. Any suggestions into how to make this easier?

3
  • Well, first, instead of running a 100 second clock you should just have a daylight sensor hooked up to a monostable (or allow for multiple ticks) if needed. This is about 50x as easy, will lead to less resources and head aches, and can't fail or have inconsistencies – Penguin Dec 18 '20 at 3:58
  • This was the original plan, but I figured the daylight sensor wouldn't be useful at night and also would be inconsistent as weather affects the output strength according to the wiki. – Tim Dec 18 '20 at 18:48
  • If you need one at night too, you could make a second night sensor that would be hooked up to the same circuit. Also it doesn't matter if it gives different strengths, just use a repeater right up against it – Penguin Dec 18 '20 at 19:39
2

Probably the easiest and most robust approach (using actual memory cells is prone to entering illegal states like 2 cells active) is to use the N-state T flip-flop design; in this case 12-state. It's a simple loop of interleaved droppers and hoppers, activated all at once by a common line of redstone dust. There's one item in the loop, and a comparators indicates in which of the droppers it is. Upon pulsing the dust with redstone signal, the item is shifted to the next dropper (ejected into a hopper on rising edge, inserted into the dropper after falling edge).

enter image description here enter image description here

As long as you maintain the topology, you can take liberties with the geometry - make it into 2 parallel lines of 6 pairs, or snaking back and forth; you can also insert more hoppers (at cost of small delay to the shift). Skipping hoppers or adding droppers without hoppers is asking for trouble though; the update order may shift the item an arbitrary number of droppers on one activation without the hopper buffer present.

1
  • Beautiful design. I took this design and added a redstone pulser that activates when the comparator for the midday hour is off and either a daylight or night sensor were at full strength. This means if I sleep in a bed or change the time in any way, the clock will notice when it hits noon or midnight and catch up. Thank you! – Tim Dec 18 '20 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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