Skip to main content

a library for raspberry pi gpio extend using aw9523b

Project description

Example

Input

from AW9523B import EX_GPIO,Port0,Port1
import time

inputPin = [Port1.PIN7, Port1.PIN6, Port1.PIN5, Port1.PIN4, Port0.PIN7,
                    Port1.PIN0, Port1.PIN1, Port1.PIN2, Port1.PIN3, Port0.PIN0]

def inputCallback(pin):
    print("inputCallback", pin)

if __name__ == "__main__":
    for pin in inputPin:
        EX_GPIO.setup(pin, EX_GPIO.INPUT)
    EX_GPIO.inputCB = inputCallback
    while 1:
        time.sleep(1)

OUTPUT

from AW9523B import EX_GPIO,Port0
import time

led1 = Port0.PIN5
led2 = Port0.PIN6

EX_GPIO.setup(led1, EX_GPIO.OUTPUT)
EX_GPIO.setup(led2, EX_GPIO.OUTPUT)



if __name__ == "__main__":
    while 1:
        time.sleep(5)
        EX_GPIO.output(led1,EX_GPIO.HIGH)
        EX_GPIO.output(led2,EX_GPIO.LOW)
        time.sleep(5)
        EX_GPIO.output(led1,EX_GPIO.LOW)
        EX_GPIO.output(led2,EX_GPIO.HIGH)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aw9523b-1.1.1.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

aw9523b-1.1.1-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page