A Python package to interface with the board, and control relays, digital inputs/outputs, and analog inputs on Raspberry Pi.
Project description
EBRPIH1118
EBRPIH1118 is a Python package designed to facilitate the control of hardware resources such as relays, digital inputs (DI), digital outputs (DO), analog inputs (AI), and temperature sensors on a Raspberry Pi. This package provides a convenient API to interact with GPIO pins and SPI devices, making it easy to develop automation applications on the Raspberry Pi.
Features
- Relay Control: Easily manage relays connected to the Raspberry Pi GPIO pins.
- Digital Input/Output: Read from and write to digital input/output pins.
- Analog Input: Read analog sensor data using SPI interface.
- Temperature Sensor Integration: Read data from 1-wire temperature sensors.
- Flexible Hardware Management: Abstract hardware interaction with a clean, easy-to-use API.
Installation
You can install EBRPIH1118 using pip. Ensure you have the necessary Python libraries for GPIO and SPI communication.
Prerequisites
Before installing EBRPIH1118, ensure that your Raspberry Pi is set up with the following libraries:
sudo apt-get update
sudo apt-get install python3-pip python3-rpi.gpio python3-spidev
Installing the Package
pip install EBRPIH1118
Usage
Importing the Package
from EBRPIH1118_intf import ebrpih1118
Example usage
from EBRPIH1118_intf import ebrpih1118
# Initialize GPIO and SPI
hardware_manager = ebrpih1118.EBRPIH1118()
# Example: Turn on relay #1
hardware_manager.energize_relay(relay_number=1)
# Example: Read an analog input from channel 1 to 4 (SPI)
analog_value = hardware_manager.read_ai_channels(channels="1,2,3,4")
print(f"Analog Input Values: {analog_value}")
# Cleanup after operations
hardware_manager.cleanup()
Steps to Contribute
Fork the repository. Create a new branch for your feature or bug fix. Make your changes. Submit a pull request to the main repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- This package uses the RPi.GPIO library for GPIO control.
- It also uses the spidev library for SPI communication.
More Information
For more details, visit our website: www.electronbits.com
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file EBRPIH1118-0.1.2.tar.gz.
File metadata
- Download URL: EBRPIH1118-0.1.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeeab42e2f0a27a233ec9f3f5012a37ade8456a4dc6a3944cfc72468baf30cfa
|
|
| MD5 |
a32b7ec0b09a48e65de7aef683fe79b6
|
|
| BLAKE2b-256 |
d563b83f6c2c98ac44c91137960d0be18aca44da7c8d0660f6dc8c4559fc5521
|
File details
Details for the file EBRPIH1118-0.1.2-py3-none-any.whl.
File metadata
- Download URL: EBRPIH1118-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
737b92cc29834092f60305520d6463e04015b98d454f41944c7dee8e1c77d704
|
|
| MD5 |
f218ee7413a0847ee971091d09f77b2a
|
|
| BLAKE2b-256 |
41cb1c2bc18a9913a937e711e6d03809899a0b4b0ce0dea11db47c08ec5e353c
|