what would be a cheap way to alternate the flow of a liquid between two outputs? It needs to be small like to accommodate hosing around 4mm. preferably cheap. this is for irrigation
Are you talking drip line irrigation?
You set up 'zones'. Each zone is run for a particular length of time i.e. 1 hour. You can then use different emitters to control how much flow you get out the end. usually 1/2, 1, and 2 gallons per hour.
You're also limited by tubing size. for example my lines I buy, the 1/4" tube is limited to a 30' run and can supply 30 gallons per hour. So I can take a 1/4" line and put a couple T's in and get 15x2gph emitters.
The zones are controlled by distribution boxes that get instructions from a controller in the house, or an all-in-one distributor connected to the spigot outside.
put a pinch clamp on each line and open only the one you want to have flow.
if you want to electronically automate this (or control it manually but with electrical switches) then you would use a solenoid valve.
Such as-- to find valves that can handle water and need 12 volts to operate, search Google for "12v water solenoid valve".
You can literally get a plastic gate valve to put either side of the tee and they will cost pennies.
Why is that difficult? What's all this bullshit talk of pinch clamps and what not.
Get real mate. Who's going to bother going to the trouble of automated solenoid valves for a bit of 4mm hose and irrigation. The valves and arduino would cost more than the irrigation system in its entirety and then some.