Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms:
To operate grove sensors, the grove.py depends many hardware interface libraries such as mraa/upm/smbus2.
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.
install/update all dependencies and latest grove.py
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
From source code
git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
# Python2
sudo pip install .
# Python3
sudo pip3 install .
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
click here
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.