Android Things with I2C LCD

Test Environment

Pin-map

gpio readall
+-----+-----+---------+------+---+--- N2 ---+---+------+---------+-----+-----+
| I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
|     |     |    3.3V |      |   |  1 || 2  |   |      | 5V      |     |     |
| 493 |   8 |   SDA.2 | ALT1 | 1 |  3 || 4  |   |      | 5V      |     |     |
| 494 |   9 |   SCL.2 | ALT1 | 1 |  5 || 6  |   |      | 0V      |     |     |
| 473 |   7 |  IO.473 | ALT1 | 0 |  7 || 8  | 1 | IN   | TxD1    | 15  | 488 |
|     |     |      0V |      |   |  9 || 10 | 1 | IN   | RxD1    | 16  | 489 |
| 479 |   0 |  IO.479 |   IN | 1 | 11 || 12 | 1 | IN   | IO.492  | 1   | 492 |
| 480 |   2 |  IO.480 |   IN | 1 | 13 || 14 |   |      | 0V      |     |     |
| 483 |   3 |  IO.483 |   IN | 1 | 15 || 16 | 1 | IN   | IO.476  | 4   | 476 |
|     |     |    3.3V |      |   | 17 || 18 | 1 | IN   | IO.477  | 5   | 477 |
| 484 |  12 |    MOSI |   IN | 1 | 19 || 20 |   |      | 0V      |     |     |
| 485 |  13 |    MISO |   IN | 1 | 21 || 22 | 1 | IN   | IO.478  | 6   | 478 |
| 487 |  14 |    SCLK |   IN | 1 | 23 || 24 | 1 | IN   | CE0     | 10  | 486 |
|     |     |      0V |      |   | 25 || 26 | 0 | IN   | IO.464  | 11  | 464 |
| 474 |  30 |   SDA.3 | ALT2 | 1 | 27 || 28 | 1 | ALT2 | SCL.3   | 31  | 475 |
| 490 |  21 |  IO.490 |   IN | 1 | 29 || 30 |   |      | 0V      |     |     |
| 491 |  22 |  IO.491 |   IN | 1 | 31 || 32 | 0 | IN   | IO.472  | 26  | 472 |
| 481 |  23 |  IO.481 |   IN | 1 | 33 || 34 |   |      | 0V      |     |     |
| 482 |  24 |  IO.482 |   IN | 0 | 35 || 36 | 0 | IN   | IO.495  | 27  | 495 |
|     |  25 |   AIN.3 |      |   | 37 || 38 |   |      | 1V8     | 28  |     |
|     |     |      0V |      |   | 39 || 40 |   |      | AIN.2   | 29  |     |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
+-----+-----+---------+------+---+--- N2 ---+---+------+---------+-----+-----+

Connection diagram

Examples

Create the Project

Android Studio → Check out project from Version Control → Git → URL: https://github.com/xiane/thingsGpioExample → Clone

Change a branch to the I2C-LCD

VCS → Git → Branches → origin/i2c_lcd → Checkout As… → OK

Uploading

After changing the branch to the LCD, connect to ODROID-N2 otg port.\ Click the Run 'app' Button.