Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(37)  |  Call(37)  |  Derive(0)  |  Import(0)
Set up the GPIO channel, direction and (optional) pull/up down control
channel        - Either: RPi board pin number (not BCM GPIO 00..nn number).  Pins start from 1
                 or    : BCM GPIO number
direction      - INPUT or OUTPUT
[pull_up_down] - PUD_OFF (default), PUD_UP or PUD_DOWN
[initial]      - Initial value for an output channel

src/p/y/python-emotiv-HEAD/examples/bbb-bci-ssvepd.py   python-emotiv(Download)
    # Setup pins
    for led in LEDS:
        GPIO.setup(led[PIN], GPIO.OUT)
        GPIO.output(led[PIN], led[VALUE])
        led[HZ] = float(freqs.pop(0))

src/m/a/matrix_keypad-1.2.2/matrix_keypad/BBb_GPIO.py   matrix_keypad(Download)
    def getKey(self):
 
        # Set all columns as output low
        for j in range(len(self.COLUMN)):
            GPIO.setup(self.COLUMN[j], GPIO.OUT)
            GPIO.output(self.COLUMN[j], GPIO.LOW)
 
        # Set all rows as input
        for i in range(len(self.ROW)):
            GPIO.setup(self.ROW[i], GPIO.IN, GPIO.PUD_DOWN)
        # Convert columns to input
        for j in range(len(self.COLUMN)):
                GPIO.setup(self.COLUMN[j], GPIO.IN, GPIO.PUD_DOWN)
 
        # Switch the i-th row found from scan to output
        GPIO.setup(self.ROW[rowVal], GPIO.OUT)
    def exit(self):
        # Reinitialize all rows and columns as input at exit
        for i in range(len(self.ROW)):
                GPIO.setup(self.ROW[i], GPIO.IN, pull_up_down=GPIO.PUD_UP) 
        for j in range(len(self.COLUMN)):

src/p/y/pynrf24-HEAD/nrf24.py   pynrf24(Download)
        self.irq_pin = irq_pin
 
        GPIO.setup(self.ce_pin, GPIO.OUT)
        GPIO.setup(self.irq_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
 

src/o/s/OSPi-HEAD/gpio_pins.py   OSPi(Download)
#### setup GPIO pins as output or input ####
try:
    GPIO.setup(pin_sr_clk, GPIO.OUT)
    GPIO.setup(pin_sr_noe, GPIO.OUT)
    GPIO.setup(pin_sr_dat, GPIO.OUT)
    GPIO.setup(pin_sr_lat, GPIO.OUT)
    GPIO.setup(pin_rain_sense, GPIO.IN)

src/p/i/pingo-HEAD/experiments/beagle/python/blink.py   pingo(Download)
atexit.register(sair)
 
GPIO.setup("P9_16", GPIO.OUT)
 
while True:

src/p/i/pingo-HEAD/experiments/beagle/python/blink_pot.py   pingo(Download)
# pinos = [16, 21, 22, 13, 12, 11]
 
GPIO.setup("P9_16", GPIO.OUT)
 
while True:

src/p/i/pingo-HEAD/experiments/beagle/python/anima.py   pingo(Download)
 
for pino in pinos:
    GPIO.setup("P9_" + str(pino), GPIO.OUT)
 
while True:

src/p/i/pingo-HEAD/experiments/beagle/anima.py   pingo(Download)
 
for pino in pinos:
    GPIO.setup("P9_" + str(pino), GPIO.OUT)
 
while True:

src/s/m/smokematic-0.1.0/smokematic/baster.py   smokematic(Download)
        self._frequency = 0
 
        GPIO.setup(self._baster_pin, GPIO.OUT)
        GPIO.output(self._baster_pin, GPIO.LOW)
 

src/a/d/Adafruit_BBIO-0.0.19/test/test_gpio_setup.py   Adafruit_BBIO(Download)
    def test_setup_output_key(self):
        GPIO.setup("P8_10", GPIO.OUT)
        assert os.path.exists('/sys/class/gpio/gpio68')
        direction = open('/sys/class/gpio/gpio68/direction').read()
        assert direction == 'out\n'        
        GPIO.cleanup()
 
    def test_setup_output_name(self):
        GPIO.setup("TIMER6", GPIO.OUT)
    def test_setup_input_key(self):
        GPIO.setup("P8_10", GPIO.IN)
        assert os.path.exists('/sys/class/gpio/gpio68')
        direction = open('/sys/class/gpio/gpio68/direction').read()
        assert direction == 'in\n'        
        GPIO.cleanup()
 
    def test_setup_input_name(self):
        GPIO.setup("TIMER6", GPIO.IN)
    def test_setup_input_pull_up(self):
        GPIO.setup("P8_10", GPIO.IN, pull_up_down=GPIO.PUD_UP)
        assert os.path.exists('/sys/class/gpio/gpio68')
        direction = open('/sys/class/gpio/gpio68/direction').read()
        assert direction == 'in\n'        

  1 | 2  Next