common:android_things:rotaryencoder

'ODROID-N2' on this page refers to the ODROID-N2 series (N2, N2+, N2L).

Android Things with Rotary Encoder

  • ODROID-C4
  • ODROID-N2
  • ODROID-M1
target board Device Tree Overlay config file path
ODROID-N2/C4 /odm/env.ini
ODROID-M1 /fat/config.ini

the “overlays” options must contain this values.

  • /odm/env.ini
target
...
overlays="pwm_ef"
...

or

  • /fat/config.ini
target
...
overlays="pwm_1"
...
Pin Number Name Usage
2 5V Rotary Encoder & Servo Motor Power
5 GND Rotary Encoder & Servo Motor Ground
7 GPIO Rotary Encoder Clock
11 GPIO Rotary Encoder Switch
12 PWM Servo Motor PWM
13 GPIO Rotary Encoder DT

Create the Project

  1. Start Android Studio & Select “Get from VCS”.
  2. Insert the repository url “https://github.com/xiane/thingsGpioExample” and clone it.

Building && Uploading

  1. Select the RotaryEncoderNServoMotor from Run Configurations menu.

  2. Connect otg cable to the ODROID Board.
  3. Select a target board and run.
  • common/android_things/rotaryencoder.txt
  • Last modified: 2023/08/16 16:12
  • by luke.go