Skip to main content

A library for operating devices connected to a Raspberry Pi

Project description

This is a Python 3 library for easily setting up devices connected to a Raspberry Pi. It contains objects and methods for DC motors with and without software PWM, servos and LEDs.

Currently, following objects are available:

  • SimpleMotor: DC Motor with bi-directional rotation (no PWM control)

  • DCMotor: DC Motor with bi-directional rotation and PWM control methods

  • Servo: Servo with PWM control and configuration methods

  • LED: LED, Laser Diode or any other device which can be controlled using a single GPIO output pin

Installation and Usage

Option 2 :

Using directly:

  1. Copy the rpi_devices/devices.py files to your Raspberry Pi.

  2. To use the objects, add the following lines at the top of your code:

    import sys
    sys.path.append("/full/path/to/devices.py")
    from devices import cleanup, <Device>-

Cautions

  1. Do not forget to run the library’s cleanup function or RPi.GPIO.cleanup() after you are done.

  2. Although all the classes in this library allow a different pin numbering mode during setup, it is strongly recommended to use the same mode across all devices. The pin numbering mode is set globally, so if devices are set with different pin numbering modes, code which is not calling a device method will automatically use the mode of the last device called, which can lead to undesirable and, at times, harmful behavior.

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

rpi_devices-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpi_devices-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rpi_devices-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rpi_devices-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0e0fc1cfed9d45280683643fad54bdde1dfa843166cc12569efa5b51aa90f566
MD5 fa7b801a12ef0fedca294bbf704704fa
BLAKE2b-256 832cbee0bffe017fd1ff6ec1075493e645277d720120bf7f56c03e95c9a3cb5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rpi_devices-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13ef31bcdd998f4ac427b84ec8a2afdddf262ce1eeb4e6bc009a815e0fa5e55a
MD5 a60d66f302f924b370f2e1b5d8ab9cc6
BLAKE2b-256 993f97debfc4a41c3a42e68ead427f6ec0f6169d611376e938f61277b937f97f

See more details on using hashes here.

Supported by

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