You must install the C2 Android Marshmallow Ver2.8 image or higher to access the 40pin GPIO properly.
This WiKi explains how to make an Android app which can access GPIO ports.
You need to install Google Android Studio on your host PC.
And add NDK and tools first before starting below steps.
We tested following steps on Android Studio 2.3 and NDK R14.
Add this line in your ~/.bashrc file after installing Android NDK.
export NDK_PATH=[YOUR ANDROID SDK LOCATION]/ndk-bundle
For example
export NDK_PATH=/home/codewalker/projects/android-sdks/ndk-bundle
You can find the Android SDK location on this menu (File → Settings → Appearance & Behavior → System Settings → Android SDK)
After editing the bashrc file, you have to login again or type “source ~/.bashrc” on the command line.
Download C2-WiringPi NDK library and App source code Project from github.
$ sudo apt install git $ git clone https://github.com/codewalkerster/example-wiringPi -b mater
Select Build → Make Project menu.
You will see a couple of error messages and click following texts to complete the build process.
Install missing platform(s) and sync project
Install Build Tools 25.0.2 and sync project
And you will have an apk file to run it on your ODROID.
Reboot Windows.
Toos → Android → SDK Manager
Basic PWM control example. You can choose the number of PWM outputs 1 or 2.
And control the frequency and duty ratio.
This is fun and useful project using the PWM port.
When you watch video or play games, you might lose a notification of the important email or message.
The flag is moving by servo motor which is connected to a PWM pin on 40pin GPIO port.
https://github.com/codewalkerster/GMailNotifier
An example code to access our Weather Board to measure the temperature, humidity, atmospheric pressure, altitude and visible/invisible light intensities via I2C
interface.
Open File Manager app.
Edit /storage/internal/boot.ini like this. (near end of file).
Before edit.
movi read dtb 0 ${dtbaddr} # load kernel from vat or boot partition. movi read boot 0 ${loadaddr} #fatload mmc 0:1 ${loadaddr} Image booti ${loadaddr} - ${dtbaddr}
After edit.
movi read dtb 0 ${dtbaddr} # load kernel from vat or boot partition. #movi read boot 0 ${loadaddr} fatload mmc 0:1 ${loadaddr} Image booti ${loadaddr} - ${dtbaddr}
Load kernel image from vfat partition built i2c.
If you could not find 'fatload' command, remove /storage/internal/boot.ini file and reboot system.