1 Star 0 Fork 0

Seeed Projects / grove.py

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

grove.py

Build Status

Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms:



Architecture

To operate grove sensors, the grove.py depends on the smbus2 hardware interface library.




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.

Caution

Here is the compatibility of grove.py with Python2 and Python3 on each releases of Raspbian/Raspberry Pi OS.

Raspberry Pi OS Releases grove.py for Python2 grove.py for Python3
9 (Stretch)
10 (Buster) until 2020-08-20
10 (Buster) after 2020-08-20 ×
11 (Bullseye) ×

Because Python2 is obsolete and APT repository does not provide python-pip, so the Raspberry Pi OS releases which after 10 (Buster) 2020-08-20 cannot use Online install command. We also recommend using Python3 to all the users and developers.

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 (This command line does not provide for Raspberrypi OS 10 (Buster) >= 2020-12-02)
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

how to update me



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> and python3 <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.
MIT License Copyright (c) 2018 Seeed Studio Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Python library for Seeedstudio Grove devices 展开 收起
Python 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/seeed-projects/grove.py.git
git@gitee.com:seeed-projects/grove.py.git
seeed-projects
grove.py
grove.py
master

搜索帮助