Skip to content
epsilonrt edited this page Oct 5, 2018 · 14 revisions

Arduino on Pi boards, the best of both worlds

Abstract

PiDuino is a C ++ library for Pi boards that allows the use of I/O like GPIO, I2C, SPI, UART ... with an API as close as possible to the Arduino language.
The description of Pi cards uses a stored "Object" model in a database that allows to add new models of boards easily.

At this time, the SoC models supported are AllWinner H-Series and Broadcom BCM2708 through 2710 which allows it to be used on Raspberry Pi, most Nano Pi, Orange Pi and Banana Pi.

PiDuino was born from a question from one of my students who asked me why programming input-output on NanoPi was not as simple as on Arduino.

PiDuino therefore aims to respond to this need:

An Application Programming Interface (API) on Pi boards as close as possible to that of Arduino.

This API must allow to use GPIO, Serial port, I2C bus and SPI... on Raspberry Pi, Nano Pi,Orange Pi, Banana Pi, Beagle Board... boards as on an Arduino board.

What PiDuino offers:

  • A programming interface API same as Arduino except adding #include <Piduino.h>at the beginning of the program. It does not prohibit offering extensions of the API but provided that stay as independent as possible from the platform and not to make the code incompatible with Arduino. It makes sense to think that users who want to stay in the Arduino world use C ++, PiDuino is intended for this use case. Nevertheless some functions can be used in C (pinMode (), digitalWrite (), ...).

  • The description of Pi boards that is based on an "Object" model stored in a database (SQLite by default), allowing a simple user to add a new Pi board "variant" WITHOUT programming.

  • An object design in C++ with a clear separation of the part specific to the platform. Support for new SoCs is summarizes to add a part "driver" in the directory src/arch

  • Utilities for manipulating GPIO signals: pido, retrieve information from the board: pinfo or manage the Pi boards database: pidbman

PiDuino is in development, version 0.3 currently but the completed parts are functional on Broadcom SoC BCM283X and AllWinner Hx.

The list of models present in the database is as follows:

Nano Pi Raspberry Pi
NanoPi Neo Core RaspberryPi 2
NanoPi Neo Core with Mini Shield RaspberryPi 3
NanoPi Neo Core2 RaspberryPi A
NanoPi Neo Core2 with Mini Shield RaspberryPi A+
NanoPi M1 RaspberryPi B
NanoPi M1+ RaspberryPi B+
NanoPi Neo RaspberryPi Compute Module
NanoPi Neo 2 RaspberryPi Compute Module 3
NanoPi Neo Air RaspberryPi Zero
NanoPi Neo+ 2 RaspberryPi Zero Wifi
Clone this wiki locally