Metadata-Version: 2.1
Name: gpiod
Version: 0.4.1
Summary: UNKNOWN
Home-page: https://github.com/hhk7734/python3-gpiod
Author: Hyeonki Hong
Author-email: hhk7734@gmail.com
License: MIT
Project-URL: Source, https://github.com/hhk7734/python3-gpiod.git
Description: ![license](https://img.shields.io/github/license/hhk7734/python3-gpiod)
        ![pypi](https://img.shields.io/pypi/v/gpiod)
        ![language](https://img.shields.io/github/languages/top/hhk7734/python3-gpiod)
        
        # python3-gpiod
        
        ## Installation
        
        ```shell
        sudo apt update \
        && sudo apt install -y python3 python3-dev python3-pip \
            gpiod libgpiod-dev pkg-config
        ```
        
        ```shell
        python3 -m pip install -U --user pip gpiod
        ```
        
        ## Blink example
        
        ```python
        import gpiod
        import sys
        import time
        
        try:
            if len(sys.argv) > 2:
                LED_CHIP = sys.argv[1]
                LED_LINE_OFFSET = int(sys.argv[2])
            else:
                raise
        except:
            print('''Usage:
            python3 blink.py <chip> <line offset>''')
            sys.exit()
        
        chip = gpiod.chip(LED_CHIP)
        
        print(f"chip name: {chip.name()}")
        print(f"chip label: {chip.label()}")
        print(f"number of lines: {chip.num_lines()}")
        
        led = chip.get_line(LED_LINE_OFFSET)
        
        config = gpiod.line_request()
        config.consumer = "Blink"
        config.request_type = gpiod.line_request.DIRECTION_OUTPUT
        
        led.request(config)
        
        print(f"line offset: {led.offset()}")
        print(f"line name: {led.name()}")
        print(f"line consumer: {led.consumer()}")
        print("line direction: " + ("input" if (led.direction()
                                                == gpiod.line.DIRECTION_INPUT) else "output"))
        print("line active state: " + ("active low" if (led.active_state()
                                                        == gpiod.line.ACTIVE_LOW) else "active high"))
        
        while True:
            led.set_value(0)
            time.sleep(0.3)
            led.set_value(1)
            time.sleep(0.3)
        ```
        
        ## Changelog
        
        Ref: CHANGELOG
        
        python3-gpiod (0.4.1) unstable; urgency=medium
        
          * Fix issue where pip does not install dependencies
        
         -- Hyeonki Hong <hhk7734@gmail.com>  Thu, 12 Mar 2020 19:11:24 +0900
        
        python3-gpiod (0.4.0) unstable; urgency=medium
        
          * Add libgpiodcxx version check
          * Remove -std=c++11 option
          * Add line_bulk, chip_iter, line_iter classes
        
         -- Hyeonki Hong <hhk7734@gmail.com>  Thu, 12 Mar 2020 14:18:16 +0900
        
        python3-gpiod (0.3.0) unstable; urgency=medium
        
          * Add open, reset function
          * Add LICENSE
          * Create README.md
        
         -- Hyeonki Hong <hhk7734@gmail.com>  Wed, 11 Mar 2020 18:58:14 +0900
        
        python3-gpiod (0.2.0) unstable; urgency=medium
        
          * Add chip, line_request, line, line_event class
        
         -- Hyeonki Hong <hhk7734@gmail.com>  Wed, 11 Mar 2020 13:28:45 +0900
        
        python3-gpiod (0.1.0) unstable; urgency=medium
        
          * Add initial setup files
        
         -- Hyeonki Hong <hhk7734@gmail.com>  Tue, 10 Mar 2020 15:40:13 +0900
        
Keywords: GPIO,gpiod
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Topic :: System :: Hardware
Description-Content-Type: text/markdown
