Incrementing Clicker?

    StormWing0

    Leads the Storm
    Joined
    Jun 26, 2015
    Messages
    2,126
    Reaction score
    316
    • Community Content - Bronze 1
    I've working on something to help deal with a chain of drones but rather than release the whole chain I want to send them out one at a time. Since they are docked to each other I want to release them from one end to the other and need a counter of some kind that both keeps track of the number of the drone it is on and also releases the correct drone.


    Stacked order: D1 => D2 => D3
    Release order: D3 => D2 => D1

    I'm working on something that uses this and need a sort of counter that keeps tract of its position. Any ideas?
     
    Joined
    Mar 1, 2015
    Messages
    291
    Reaction score
    176
    • Wired for Logic
    • Community Content - Bronze 2
    • Purchased!
    I had a similar system on my robotic hand. It allowed it to skip memory cells that did not have data, while still allowing the hand play the other animations in demo mode.

    However, that system is way to complex for the function you need. Instead, build a flip-flop counter. Chain flip flops in a line (two is all you need in this case) and link the activating logic to the first one. You now have a reverse counter. It will output a sequence of bits in this order= 00(off) 1 1, 0 1, 1 0, repeat, each time it is toggled.
    Stacked order: D1 => D2 => D3
    Release order: D3 => D2 => D1
    You will then have to decode the bits to undock individual drones based on the counter. Slave an AND to the flip flops, and it will only activate when the counter hits 1 1. This will activate first, so connect this to D3.
    Slave a NOT to the first flip flop, and connect it to a second AND. Then connect the other flip flop to this second AND. This will activate when the counter hits 0 1. This will activate second, so connect this to D2.
    Slave a NOT to the second flip flop, and connect it to a third AND. Then connect the other flip flop to this third AND. This will activate when the counter hits 1 0. This will activate last, so connect this to D1.
    For stability, I suggest you hook up a delay block to the toggle circuit, and slave all the ANDs to it. This will prevent the circuit from breaking and accidently activating multiple drones at once. However, if you don't mind the slight chance for a glitch, you can omit this feature.

    I have used this circuit on my battleship before my computer caved in. From my testing, the circuit was suitable for activating circuits in a set sequence, in my case, setting the height of the docking pylons in the hangar bay with one button.

    EDIT: One more thing to note, this circuit will reset if you toggle it a fourth time.
     
    Last edited:

    Tunk

    Who's idea was this?
    Joined
    Sep 8, 2013
    Messages
    363
    Reaction score
    153
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    Thought I would upload a animation of a binary counter for folks who are more visual:
    starmade-gif-0011-small.gif

    The flip flop on the right is the one you want to flip, it is then linked to the next flip flop on the left.
    Both of these feed into the not gates above them.
    You will notice watching this you have 4 states in the system.
    Both on.
    Left on.
    Right on.
    Both off.

    Now a added bonus of this is you can literally count as fast you you can move that flip flop, which means you can count most muxed signals.
     
    • Like
    Reactions: PizzaPress
    Joined
    Jan 25, 2015
    Messages
    964
    Reaction score
    225
    • Wired for Logic
    • Councillor 2 Gold
    • Legacy Citizen 5
    Thought I would upload a animation of a binary counter for folks who are more visual:
    View attachment 18357

    The flip flop on the right is the one you want to flip, it is then linked to the next flip flop on the left.
    Both of these feed into the not gates above them.
    You will notice watching this you have 4 states in the system.
    Both on.
    Left on.
    Right on.
    Both off.

    Now a added bonus of this is you can literally count as fast you you can move that flip flop, which means you can count most muxed signals.
    you can add flip flops if you want to control more than 4 drones, if I'm right I'd just be 2,4,6,8,10,12,14 etc.

    it's more like a side note for StormWing0
     
    Joined
    Mar 1, 2015
    Messages
    291
    Reaction score
    176
    • Wired for Logic
    • Community Content - Bronze 2
    • Purchased!
    Actually it is exponential. One has two states, two has four, three has nine, four has sixteen, five has 32, six has 64, seven has 128, and eight has 256. As you can see, the amount of states double with each flip-flop, thus making it very useful for long delays. And especially for cycling through multiple inputs/outputs.
     
    Joined
    Jan 25, 2015
    Messages
    964
    Reaction score
    225
    • Wired for Logic
    • Councillor 2 Gold
    • Legacy Citizen 5
    Actually it is exponential. One has two states, two has four, three has nine, four has sixteen, five has 32, six has 64, seven has 128, and eight has 256. As you can see, the amount of states double with each flip-flop, thus making it very useful for long delays. And especially for cycling through multiple inputs/outputs.
    hadn't really looked at it, thought it was a simple system, not binary xD
    anyway you can copy the first design and make that design start once the last one reached number 4.
    then it it 4,8,12,16 etc.
     
    Joined
    Jul 14, 2013
    Messages
    98
    Reaction score
    27
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    Thought I would upload a animation of a binary counter for folks who are more visual:
    View attachment 18357

    The flip flop on the right is the one you want to flip, it is then linked to the next flip flop on the left.
    Both of these feed into the not gates above them.
    You will notice watching this you have 4 states in the system.
    Both on.
    Left on.
    Right on.
    Both off.

    Now a added bonus of this is you can literally count as fast you you can move that flip flop, which means you can count most muxed signals.
    The concept behind what you are doing is outlined here, as the way you describe it visually is vapid, and the way you described it in words was unintelligible.


    Here the concept it using JK flip flops in order to make a counter using the ability of JK flip flops to toggle when both J and K are high (1), we can there for replace these JK flip flops with T flip flops, where we only have a T, and when ever it is high (1) we toggle the output.

    Using this we can simply chain two or more T flip flops to create a counter (with the first attached to a pulse or button of some sort), however we must invert the output to get proper values since we aren't actually using flip flops, we are using latches (what the T block actually is) and will cause all blocks to be set on initial button toggle, which explains why we need not gates to show outputs.

    This will implement the counter, and you must hook the not gates and T flip flops (which now correspond to the inverse of the output) to blocks that correspond to each value, so you will need to connect the binary value of one to one AND gate, the binary value for two to the next AND gate and so on.

    But the need for inverting the counter T latches is not even necisary if we want an increasing counter, as seen here

    http://starmadedock.net/threads/instant-pulses-and-some-starmades-logic-details.8117/

    If we connect the T blocks in the same as before, but connect one button to all of the Tblocks and we get a incremental counter.
     
    Last edited: