Skip to main content

Generic API to control boards with programmable IO pins.

Project description

Pingo provides a uniform API to program devices like the Raspberry Pi, BeagleBone Black, pcDuino etc. just like the Python DBAPI provides an uniform API for database programming in Python.

The API is object-oriented but easy to use: a board is an instance of a Board subclass. Every board has a dictionary called pins which lists all GPIO pins on the board. Each pin is an instance of a Pin subclass with attributes that you can inspect to learn about its capabilities.

The name Pingo is a tribute to Garoa Hacker Clube, where it started (Portuguese skills needed to understand the link). To our English-speaking friends we like to say that it means “pin, go!” – the main purpose of this package.

Basic usage

Blink.py on an UDOO board:

import pingo
from time import sleep

board = pingo.udoo.Udoo()
led_pin = board.pins[13]
led_pin.set_mode(pingo.OUTPUT)

while True:
    led_pin.high()
    sleep(1)
    led_pin.low()
    sleep(1)

To do the same on a Arduino Yún, just change the line were the board is instantiated, and the pin numbers as needed:

import pingo
from time import sleep

board = pingo.arduino.yun.YunBridge()  # <---
led_pin = board.pins[13]
led_pin.set_mode(pingo.OUTPUT)

while True:
    led_pin.high()
    sleep(1)
    led_pin.low()
    sleep(1)

Drivers

In the examples above, pingo.udoo pingo.arduino.yun are drivers, and the respective Udoo and YunBridge are classes implementing the pingo.board.Board interface.

The following table lists the drivers currently planned or under development.

Board

Type

Package

Notes

Arduino Firmata

remote

arduino.firmata

requires firmata library on any Arduino board

Arduino Yún

on-board

arduino.yun

requires Bridge sketch on the Arduino Yún

BeagleBone Black

on-board

beagle

Fantasma

mock

ghost

not a real board, just a mock for testing clients

Raspberry Pi

on-board

rpi

pcDuino

on-board

pcduino

UDOO

on-board

udoo

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pingo-0.1.5.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file pingo-0.1.5.tar.gz.

File metadata

  • Download URL: pingo-0.1.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pingo-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5d83dc08950c954e2b52b8e8c35a0d84392514344db28d22bfd99897bfb4d3a7
MD5 406f925debef848b26ceb74024eb3945
BLAKE2b-256 dc0773e8321ab2b41f01c8a8172918ae7ff77449ef4cb9acc2eec71c0b14e57a

See more details on using hashes here.

Supported by

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