Python library for Seeedstudio Grove devices
Project description
grove.py
Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms:
Architecture
To operate grove sensors, the grove.py depends many hardware interface libraries such as mraa/upm/smbus2.
Installation
For beginner or library user only, please install with online method.
For developer or advanced user, please install dependencies
and then install grove.py with source code.
Online install
install/update all dependencies and latest grove.py
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
Install grove.py
From source code
git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
# Python2
sudo pip install .
# Python3
sudo pip3 install .
Usage
Basic GPIO Input & Output demo
import time
from grove.gpio import GPIO
led = GPIO(12, GPIO.OUT)
button = GPIO(22, GPIO.IN)
while True:
if button.read():
led.write(1)
else:
led.write(0)
time.sleep(0.1)
See more demos and how to run
API Documentation
click here
Contribution
Check list for adding a new grove device, for simple, take grove_led as a example.
- Add a Class in the python source file, and export with
__all__ =
- Code sytle PEP8 is recommanded
- The python source could run directly with
python <file>
andpython3 <file>
- Add demo code at the near top of source file
- The demo code could run directly with someone python/python3 IDE.
- Add document to class and it's member and show the result by refering to API document
- Add a command item in setup.py
console_scripts
list, take effect by install again - Add a item to command table in Usage Doc
- If the command need argument but not specified, please list available arguments.
- If specified invalid argument, also output usage document then exit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for Seeed_grove.py-0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 302fd9bce5a1cb624c5618c988bdb58438c69a3bae68af0c8b30a0c517cd71ed |
|
MD5 | 8ad32db81f4c70a4650c90d78fb57cf8 |
|
BLAKE2b-256 | 3d56adad020907b499054c6de3486f63e1cb494a74224c0b0588eae47a36344b |
Hashes for Seeed_grove.py-0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a40264d1246e4ac769998ea2f890a0fd1705af883971ec2868fd2a3407875e0a |
|
MD5 | 7aeff81ecd5c7e0ec80071d1e6603744 |
|
BLAKE2b-256 | d6fa3fcdb9a93772bb4f42b58d76c2fa4f5ac5a9cde350abc6bf8dd76e99d641 |