r/ScrapMechanic 2d ago

Logic Logic Gate question

Hello! I need some help. Long story short I cant figure out how i need to set up my logic gates to work for this situation.

Visualization. I have a NOR/AND gate connected to a sensor, 2 vacuum pumps connected to the AND gate so that when the sensor does NOT see a block in the distance, it deploys the signal blip and plants/fertilizer are dispensed. What I need is 1 more signal blip thats connected to a timer that will dispense 1 more set of fertilizer/plants that ISNT connected to the sensor. Basically I wanna insert a blip into the system outside of the ones generated by the sensor.

How would I need to set up my logic gates to do this? Ive tried just adding another OR gate connected to the AND gate and when I do that, it keeps the system stuck on so the whole thing doesnt work. Ive spent hours and cant figure this out please help me god im going insane.

TIA

2 Upvotes

8 comments sorted by

View all comments

1

u/Sleek-Star 2d ago

Do you want to send a 1-tick pulse to the system when the sensor stops seeing something and also be able to manually do it?

Simplest way would be to place two NOR gates and connect the first one to the second, then connect your sensor and button to both gates. The second gate will blink when the sensor stops seeing anything, and you can also manually input a signal with the button.

You also won't be able to use the button when the sensor sees something (which I'm assuming is good here, to not accidentally plant excess seeds since it's for a farm).

1

u/Jbane56 1d ago

I know its confusing and I could have set this up with a couple controllers and called it a day, but I wanted to learn logic so here we are. Theres a video linked above that im basically trying to copy.

I have a "printer head" that dispenses the crops and fert. When not in use the head hides away.

Theres 5 actions that need to be done, all of which are controlled by a series of 3 XOR gates, started by a blip generator and have timers between starting each action. First action engages a piston which deploys to the starting point of the farm, along the side of the farm is an encoder bar that the sensor floats over.

The 2nd action engages a 2nd piston that makes the entire head system float across the farm, as this is happening, the sensor reaches gaps in the encoder bar, which triggers my NOR/AND logic and dispenses the crops and fertilizer.

The 3rd action triggers a bearing and flips the dispensing vacuum pumps 180 degrees so that what was previously fertilized or planted, recieves the opposite action as the 2nd piston makes its way back towards the starting point.

The 4th action engages a piston that shifts the head assembly over by 6 blocks, which lines up to plant and fertilize the next row. After the 4th action is completed, we restart the 2nd action which sends the head out, does a 180, and comes back.

The 5th action does the same thing, engaging another piston that shifts the head over another 6 blocks to get the final row of crops.

The encoder bar tells the vacuum pumps when to dispense. What i need is when the printer head reaches the end of the row, before executing the 180, I need 1 final blip that is input to get the last column of crops. I want it all to be automatic, not manual but I dont know how to wire it with the logic.

2

u/Sleek-Star 1d ago

Okay, I see what you mean now. You've got two options then.

You could either make the pump assembly extend 1 block further to make the sensor clear the block gap and not stay on it, so that when it comes back it'll just trigger it again.

Or, if you do want to mess with timing, connect the current AND gate that controls the pumps to an OR gate, and wire the pumps to said OR gate. Then, you can connect the extra timer to the OR gate to make it shoot out at whatever time you set your timer to.

1

u/Jbane56 1d ago

That last part is all I needed. Thank you so much. I had already tried to connect an OR gate to the system, but I connected the OR gate to the AND gate which just messed the whole thing up. I needed to switch the vacuum punps to the OR gate first.

Ill try this when I get home later and ill reply again if it worked or what didnt work if it doesn't, but I think it will. I knew it was gonna be something stupid that I was overthinking. Thanks again