Unlike the RaspberryPi, to use the BananaPi 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 "odroid".
You can configure a Java system property named "pi4j.platform" to a value of "odroid".
You can configure the platform in your Java code before you instantiate the Pi4J controller instance.
// #################################################################### // // since we are not using the default Raspberry Pi platform, we should // explicitly assign the platform as the Odroid platform. // // #################################################################### PlatformManager.setPlatform(Platform.ODROID);
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 OdroidXU4Pin enumeration that is used to manage the accessible GPIO pins.
The Odroid XU4 board contains a 30-pin GPIO expansion header labeled CON10 providing access to 22 GPIO pins and 2 AIN (analog input) pins. The Odroid XU4 board also includes a 12-pin header labeled CON11 which provides an additional 2 GPIO pins.\
WARNING: All GPIO and AIN pins use 1.8VDC for signaling. Do not attempt to connect 3.3VDC or 5VDC to these header pins.
(The CON10 and CON11 headers are illustrated below)
The Odroid XU4 board has an optional accessory XU4 Shifter Shield board that re-aligns the pins to closely match the pinout on a Raspberry Pi 40-pin GPIO header. The shifter shield also level shifts the voltages on the GPIO pins to use either a 3.3VDC or 5.0VDC reference rather than the 1.8VDC reference voltage on the XU4 board.
If you are a hobbyist and/or comfortable using Arduino and Raspberry Pi, then this shifter shield is highly recommended.
The diagram below illustrates the GPIO pinout using the Pi4J/WiringPi GPIO numbering scheme for the CON10 header.
WARNING: All GPIO and AIN pins use 1.8VDC for signaling. Do not attempt to connect 3.3VDC or 5VDC to these header pins.
The diagram below illustrates the GPIO pinout using the Pi4J/WiringPi GPIO numbering scheme for the CON11 header.
WARNING: All GPIO and AIN pins use 1.8VDC for signaling. Do not attempt to connect 3.3VDC or 5VDC to these header pins.
The diagram below illustrates the GPIO pinout using the Pi4J/WiringPi GPIO numbering scheme for the XU4 Shifter Shield GPIO 40-pin header.
A number of source code examples are provided to demonstrate the following capabilities/integrations:
Hardware-based PWM is not supported on the Hardkernel Odroid XU4 board.
SoftPWM is not supported on all Odroid GPIO pins on the C1/C1+/C2/XU4. This limitation is due to a GPIO pin mapping issue in the WiringPi port for Odroid by Hardkernel.
SPI modes (other than the default SPI MODE 0) are not supported in the Hardkernel Odroid WiringPi port.