예제 #1
0
 def __init__(self, port, rising_event = None, falling_event = None, debounce = 5):
     assert port.DAC is not None, '! Audio poke needs port with DAC.'
     self.input = _h.Digital_input(port.DIO_A, rising_event, falling_event, debounce)
     self.LED = _h.Digital_output(port.POW_A)
     self.SOL = _h.Digital_output(port.POW_B)
     if port.POW_C is not None:
         self.POW_C = _h.Digital_output(port.POW_C)
     self.audio_output = _a.Audio_output(port.DAC)
예제 #2
0
 def __init__(self,
              port,
              rising_event=None,
              falling_event=None,
              debounce=5):
     self.input = _h.Digital_input(port.DIO_A, rising_event, falling_event,
                                   debounce)
     self.LED = _h.Digital_output(port.POW_A)
     self.SOL = _h.Digital_output(port.POW_B)
     if port.POW_C is not None:
         self.POW_C = _h.Digital_output(port.POW_C)
예제 #3
0
 def __init__(self,
              port,
              rising_event_A='lick_1',
              falling_event_A='lick_1_off',
              rising_event_B='lick_2',
              falling_event_B='lick_2_off',
              debounce=5):
     self.lick_1 = _h.Digital_input(port.DIO_A, rising_event_A,
                                    falling_event_A, debounce)
     self.lick_2 = _h.Digital_input(port.DIO_B, rising_event_B,
                                    falling_event_B, debounce)
     self.SOL_1 = _h.Digital_output(port.POW_A)
     self.SOL_2 = _h.Digital_output(port.POW_B)
    def __init__(self):
        # PINS should be exactly Ndirections x NstimPerDir strings
        # specifying the pins! iterating over Direction and Odour, Odour ==0 is clean air
        self.Ndirections = 5
        self.NstimPerDir = 2
        pins = (
            'W16',
            'W50',  # Dir1
            'W60',
            'W22',  # Dir2
            'W45',
            'W43',  # Dir3
            'W24',
            'W10',  # Dir4
            'W68',
            'W66')  # Dir5
        powerlines = (
            'W16', 'W50', 'W60', 'W22'
        )  # this variable indicates the POW pins used so that their logic level is inverted automatically.

        counter = 0
        for dir in range(self.Ndirections):
            for stim in range(self.NstimPerDir):
                sol = self._sol_name(dir, stim)
                setattr(
                    self, sol,
                    _h.Digital_output(pin=pins[counter],
                                      inverted=pins[counter] in powerlines))
                getattr(self, sol).off()

                counter += 1
예제 #5
0
 def __init__(self,
              port,
              rising_event=None,
              falling_event=None,
              debounce=5):
     self.input = _h.Digital_input(port.DIO_B, rising_event, falling_event,
                                   debounce)
     self.LED = _h.Digital_output(port.POW_B)
예제 #6
0
 def __init__(self, input_pin, LED_pin, rising_event, falling_event,
              debounce):
     self.input = _h.Digital_input(input_pin, rising_event, falling_event,
                                   debounce)
     if LED_pin: self.LED = _h.Digital_output(LED_pin)
예제 #7
0
 def __init__(self, port=None, direction_pin=None, step_pin=None):
     if port:
         direction_pin = port.DIO_A
         step_pin = port.DIO_B
     self._direction = _h.Digital_output(direction_pin)
     self._step = _h.Digital_output(step_pin, pulse_enabled=True)
예제 #8
0
# This is an example hardware definition for use with pyControl D-series breakout v1.6
# Nosepokes are plugged into ports 1-3, and a houselight is in port 4.
from devices import *
import pyControl.hardware as _h

board = Breakout_dseries_1_6()

left_poke = Poke(board.port_1,
                 rising_event='left_poke',
                 falling_event='left_poke_out')
right_poke = Poke(board.port_2,
                  rising_event='right_poke',
                  falling_event='right_poke_out')
center_poke = Poke(board.port_3,
                   rising_event='center_poke',
                   falling_event='center_poke_out')
houselight = _h.Digital_output(board.port_4.POW_A)
예제 #9
0
 def __init__(self, port, lever_event, debounce=100):
     self.press = _h.Digital_input(port.DIO_B,
                                   rising_event=lever_event,
                                   debounce=debounce,
                                   pull='up')
     self.motor = _h.Digital_output(port.DIO_A)
예제 #10
0
    def __init__(self, task_port, solenoid_port, infrared_port):

        self.task_status = _h.Digital_output(task_port)
        self.solenoid_status = _h.Digital_output(solenoid_port)
        self.infrared_status = _h.Digital_output(infrared_port)
예제 #11
0
 def __init__(self, port, nose_event, debounce = 5):
     self.nose = _h.Digital_input(port.DIO_A,  nose_event,  nose_event+'_out',  debounce)
     self.LED = _h.Digital_output(port.POW_A)
     self.IR_LED = _h.Digital_output(port.POW_B)
     self.IR_LED.on()