Pin Numbering - LeMaker BananaPro

Platform Configuration

Unlike the RaspberryPi, to use the BananaPro board you must first configure the Pi4J library to use an alternate platform implementation.

There are three methods to configure the platform. You are free to use any of these three methods.

  • Method 1 : Environment Variable

    You can set the "PI4J_PLATFORM" environment variable to a value of "bananapro".

  • Method 2 : Java System Property

    You can configure a Java system property named "pi4j.platform" to a value of "bananapro".

  • Method 3 : Inline Java Code

    You can configure the platform in your Java code before you instantiate the Pi4J controller instance.

    // ####################################################################
    //
    // since we are not using the default Raspberry Pro platform, we should
    // explicitly assign the platform as the BananaPro platform.
    //
    // ####################################################################
    PlatformManager.setPlatform(Platform.BANANAPRO);

Numbering Scheme

Pi4J uses an abstract pin numbering scheme to help insulate software from hardware changes.
Pi4J implements the same pin number scheme as the Wiring Pi project. More information about the WiringPi pin number scheme can be found here: http://wiringpi.com/pins/

Pi4J provides a BananaProPin enumeration that is used to manage the accessible GPIO pins.

Expansion Headers

The BananaPi board contains a 40-pin expansion header labeled as 'CON6' providing access to 27 GPIO pins. (The CON6 header is illustrated below)

CON6 Pinout (40-pin Header)

The diagram below illustrates the GPIO pinout using the Pi4J/WiringPi GPIO numbering scheme.

(click here for hi-resolution image)

Examples

A number of source code examples are provided to demonstrate the following capabilities/integrations:

  • GPIO Input read state for single pin
  • GPIO Input read state for all pins
  • GPIO Input event listener for a single pin
  • GPIO Input event listener for all pins
  • GPIO Output
  • I2C Communication
  • SPI Communication
  • Serial/UART Communication
  • Hardware-based PWM (1 hardware PWM pin supported)
  • Software-based PWM
  • System Info

View BananaPro Examples

Additional Resources