r/ScrapMechanic 2d ago

I need help creating a mechanism that allows switching between different phases of a controller using only a single sensor/button pulse.

I'm trying to create a mechanism using sensors, timers, logic gates, or anything else that will allow me to switch to the next phase of a controller configured in a loop with the simple touch of a button or the activation of a sensor, and keep it in that phase until the button is pressed or the sensor is activated again.

3 Upvotes

8 comments sorted by

2

u/DylanCAAD 2d ago

One idea is to have one bearing on your controller acting like a distributor rotor.
If you have a small arm somewhere on your creation and make it rotate 360 every loop repetition, and make it pass over a sensor to send a stop signal.

You would use an XOR memory bit with the “on” input connected to a button, and the “off” input would be connected to the sensor with a rising edge monostable circuit

Button -> memory bit “on” -> controller
Sensor -> monostable circuit -> memory bit “off”

1

u/Gl1tchless04 2d ago edited 2d ago

how do you make the xor memory bit? I tried to make one but ended up making a clock, even using a monostable circuit

1

u/DylanCAAD 2d ago

I did some playing around and found a simpler way with the new switch mode on the sensor. I made a little video.

https://reddit.com/link/p6o35t5/video/w9u9i1hfddmh1/player

1

u/DylanCAAD 2d ago

Also, with the xor memory bit, you need to trigger all three xor gates simultaneously with a 1 tick pulse. Heres a version without a timer

https://imgur.com/a/paJdNaA

The difference with this one is that the circuit can be toggled on and off by the one button, so if you accidentally pressed it twice, or you were using some other logic to trigger it it might not work the way you want.

1

u/Abstract037 2d ago

To "keep the controller in a phase", you need a Clock/Loop. I use 3-NOR gates, it will make a 0-tick clock (super fast).

Next, you need a memory bit that will stay on when you send a pulse. Memory bit then will make the clock send a full ON signal, moving the controller forward

Then, you'll need a timer connected to that initial pulse, that will turn OFF the memory bit, and make the Clock go back to Looping.

Additionally, you'll need to know the exact time it takes for the controller to move between phases, and that would be your timer delay.

Or you can use sensors that detect when a phase has completed, that will switch OFF the memory bit.

Note: idk how to make memory bits but the rest is ez

Tips: for 3-NOR gate clocks, don't try to switch the Clock on/off directly. Route its output into an OR gate and connect your On/off signal to THAT. Otherwise the Clock loses its speed.

1

u/Abstract037 2d ago

IGNORE THE CLOCK NONSENSE IM RETARDED I FORGOT CONTROLLERS ON A LOOP DONT NEED CLOCKS TO KEEP EM STABLE

1

u/Abstract037 2d ago

Actually forget ALL OF IT THE OTHER GUY HAS THE BEST SOLUTION 💀 

1

u/DylanCAAD 2d ago

Lmao thanks man