Pingo means "pin, go!"
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 the project started (the words pingo and garoa are related in Portuguese). To our English-speaking friends we like to say that it means "pin, go!" -- the main purpose of this package.
Watch it on Youtube: https://www.youtube.com/watch?v=pAOooxPL_tQ
Intel IoT RoadShow São Paulo 2014
pingo, the first step is to instantiate a
Board. Each Pingo driver is a concrete board subclass, for example,
pingo.arduino.ArduinoFirmata are two such classes.
Pingo can automatically detect the board in most common cases. If the script is running on a supported board,
pingo.detect.MyBoard() returns an suitable board instance. If Pingo is running on an unsupported machine (eg. a notebook), it will try to find a connected Arduino using the Firmata protocol via USB and -- if successful -- will return a
Once you have a board instance, it's possible to access its pins through the
import pingo from time import sleep board = pingo.detect.get_board() led_pin = board.pins led_pin.mode = pingo.OUT while True: led_pin.hi() sleep(1) led_pin.lo() sleep(1)
pingo.galileo.Galileo2 are examples of drivers, and the respective
Galileo2 are subclasses of the
pingo.board.Board abstract class that defines the common API for all boards.
The following table lists the drivers currently planned or under development.
||level 1||requires firmata protocol on any Arduino board|
||level 2||requires Bridge sketch on the Arduino Yún|
||level 1||requires `Adafruit_BBIO`_ on the BeagleBone Black|
|Intel Galileo Gen 2||on-board||
||level 2||requires Intel IoT Dev Kit mraa library|
||level 1||requires Intel IoT Dev Kit mraa library|
||level 0||requires RPi.GPIO on the Raspberry Pi|
We are also interested in supporting: Banana Pi, Cubietech Cubieboard, SolidRun HummingBoard, TI MSP430 (via firmata protocol ).
In a addition, Pingo implements
ghost, a mock software-only board for testing the API.
Types of drivers
- Pingo and user code run on the board itself, using the Python interpreter installed in it.
- Pingo and user code run on host computer connected to board, controlling the board remotely. Useful for boards that are unable to run Python, like the Arduino UNO.
- Pingo and user code run on host computer emulating a dummy board in software. Useful for testing base classes from
board.pyand for teaching and demonstration.
Status of drivers
- level 0
- Digital I/O: get/set high/low status of digital pins (no PWM support).
- level 1
- Analog input: read values from analog pins.
- level 2
- PWM output: set variable value for digital pins with PWM capability.
- Some Python experiments have been done with the board. See the
experiments/directory for code that may be helpful to start a new driver for a board.
- Nothing has been done. Great opportunity for you to contribute with experiments and/or start a new driver.