Skip to main content

Client library for rpio-server

Project description

Python client library for rpio-server.

Installation

pip install rpio-client

API

All API in one example:

import asyncio
from rpio_client import *

@asyncio.coroutine
def main(loop):
    client = RpioClient(loop)  # create client
    yield from client.connect()  # connect to server

    pin = client.get_pin(13)  # get pin 13 instance
    yield from pin.set_mode(Mode.input)  # set input mode
    yield from pin.set_pull(Pull.down)  # set pulling to ground
    print(yield from pin.read())  # print state on pin 13

    # blinking
    pin = client.get_pin(10)
    pin.set_mode(Mode.output)
    for _ in range(10):
        yield from pin.toggle()
        yield from asyncio.sleep(1)

    yield from client.close()  # close connection

loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))

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

rpio-client-1.0.2.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file rpio-client-1.0.2.tar.gz.

File metadata

File hashes

Hashes for rpio-client-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2763a025994fd39bad87347179ef2cc2a3f2b90da4c722ba4a0478ac6ef61151
MD5 348947d0b92588932b814e4c2669a302
BLAKE2b-256 70c2dc8b2003ce62941b694d2617eb373a9a1c1cb6f1ef352e2f36a6149dbfa2

See more details on using hashes here.

Supported by

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