Exemplo n.º 1
0
def getValOut(pinnum):
    "This prints a passed string into this function"
    gpio_in = GPIO(pinnum, "out")
    value = gpio_in.read()
    gpio_in.close()

    return value
Exemplo n.º 2
0
def printme(pinnum, boolval):
    "This prints a passed string into this function"
    gpio_out = GPIO(pinnum, "out")
    value = boolval
    gpio_out.write(value)
    gpio_out.close()
    return str(True)
Exemplo n.º 3
0
import time
from gpio import GPIO

FPGA_RESET_PIN = 12  # RPI_TMS = GPIO12 works as SPI_MISO3 - temporarily reset input for FPGA

if __name__ == '__main__':
    try:
        reset = GPIO(FPGA_RESET_PIN)
        print(f'Resetting FPGA using RPi GPIO {FPGA_RESET_PIN}...')
        reset.set(1)
        time.sleep(1)
        reset.set(0)
        print('Done.')
    finally:
        reset.close()