Skip to main content

Interfaces for various GPIO devices on Raspberry PI

Project description

GPIO One

GPIO One is an unofficial user-created set of modules to allow you to easily use various input/output devices on your Raspberry Pi when the default library and GPIOzero don't have any useful code. It hopes to fill in some of the blanks that keep you from getting your projects up and running quickly and smoothly.

It currently provides interfaces to:

  • Three colored RGB Leds.
  • Seven Segement LED displays such as single-element 5161AS and 4-element SH5461AS
  • LCD Displays such as the 1602A
  • Shift registers such as 74HC595
  • Analog-to-Digital via the MCP3008/4 chip line. And built on top of the raw ADC, interfaces for:
    • Analog Joysticks
    • Thermistors

Examples

The example files use environment variables to set pins so that we will not accidentally send something down the wrong pin and damage equipment. So for example, if you have a Common-cathode RGB LED set up with the Cathode tied to ground, and the Red, Green, and Blue pins to GPIO 4, 5, and 6 (with a 220 Ohm Resistor in between each connection!) then you can simply go to the examples directory, run RED=4 GREEN=5 BLUE=6 python3 rgb_led.py and the LED should come to life.

Each example can be run without environment variables for instructions and a description:

pi@raspberrypi:~/src/gpioone/examples $ python3 rgb_led.py 
Couldn't find required environment setting fo RED pin.

Simple examples with RGB LEDs.

It will first turn on the LEDs one by one, then enter a color cycle mode that uses software PWM to create a glowing light.

These are the required settings which should correspond to pins on devices:

    RED - Red Pin
    GREEN - Green Pin
    BLUE - Blue Pin

Example Usage:

    RED=1 GREEN=2 BLUE=3 python3 /home/pi/src/gpioone/gpioone/example_help.py

pi@raspberrypi:~/src/gpioone $ 

Thanks

Gpioone was primarily written to help the author learn more about interfacing various hardware with the Raspberry Pi. I have made attempts to write clear, easy-to-follow code that should be generally reusable. How useful this is to anyone else remains to be seen. Let me know if you find it helpful!

  • Grant

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

gpioone-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

gpioone-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file gpioone-0.1.0.tar.gz.

File metadata

  • Download URL: gpioone-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for gpioone-0.1.0.tar.gz
Algorithm Hash digest
SHA256 125e261d9ef2e0bddbb7771fc5b2d6f82d591769ab52e1d85581b7b69b2f88b0
MD5 47f5d5b1098bcacbcb41192342965351
BLAKE2b-256 e91a2f3e0dea4e107d06f4046f13e28cb7d201b53c79999484632bb6c47e60fa

See more details on using hashes here.

File details

Details for the file gpioone-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gpioone-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for gpioone-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12f23b99ebc16546f06417fdb4a6a4c439233976e3ebbdbed55b2edcf4d19ec0
MD5 2d3d98dbd7e427e90b6f7cc8af992714
BLAKE2b-256 b197e1d6195b096734740791a37036683d721dbc565956a75ffcf840278dbe93

See more details on using hashes here.

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