Device: Gate - fdechaumont/micecraft GitHub Wiki
The gate is a sorter, or a flow controller of your animals. It grants access to animals to specific area of your experiment.
In the example bellow, the 2 gates are used to grant an access from the living area to the test blocks. In that case, the gate lets one animal go through, and wait for its return in the housing area.
The gate has several pre-programmed mode: todo: add video examples
| Mode / Order | Description (using side A to side B example) |
|---|---|
| Only one animal in side A Only one animal in side B |
The gate lets one animal go through, and wait for its return in the housing area. |
| Allow a single animal from side A to side B Allow a single animal from side B to side A |
The gate lets one animal at a time go through the gate from the A side to the B side. Then the gate waits for another animal from side A to get into the gate. In this mode, the animals cannot come back to side A. |
| Allow multiple animals from A to B Allow multiple animals from B to A |
The gate will allow any number of animal to go though at once, but will ensure that the animals go from A to B but never from A to B |
| empty gate to side A & empty gate to side B | If animals are in the gate, the gate opens on the specified side and will close once no animal is present in the gate |
| No order | The gate will not do anything. Still, safeties at doors are still on. (see safety section) |
If you want to have the gate automatically sending only one animal to your test block, you just need those lines of code:
from micecraft.devices.gate.Gate import Gate, GateOrder
if __name__ == '__main__':
gate = Gate( COM_Servo="COM12", COM_Arduino="COM13", COM_RFID="COM14" )
gate.setOrder( GateOrder.ONLY_ONE_ANIMAL_IN_A )
input("Hit enter to stop example")If you right click on the interface, this menu pops:
|
|
Gate in GUI: https://github.com/fdechaumont/micecraft/blob/main/src/micecraft/examples/GateInGui.py