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.
You can set the "PI4J_PLATFORM" environment variable to a value of "bananapro".
You can configure a Java system property named "pi4j.platform" to a value of "bananapro".
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);
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.
The BananaPi board contains a 40-pin expansion header labeled as 'CON6' providing access to 27 GPIO pins. (The CON6 header is illustrated below)
The diagram below illustrates the GPIO pinout using the Pi4J/WiringPi GPIO numbering scheme.
A number of source code examples are provided to demonstrate the following capabilities/integrations: