NanoPi gpio pins read

credit: wiringNP


 +-----+-----+----------+------+---+-NanoPI M1+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
 |  12 |   8 |    SDA.0 |   IN | 0 |  3 || 4  |   |      | 5V       |     |     |
 |  11 |   9 |    SCL.0 |   IN | 0 |  5 || 6  |   |      | 0v       |     |     |
 | 203 |   7 |   GPIO.7 |   IN | 0 |  7 || 8  | 0 | IN   | TxD3     | 15  | 198 |
 |     |     |       0v |      |   |  9 || 10 | 0 | IN   | RxD3     | 16  | 199 |
 |   0 |   0 |     RxD2 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO.1   | 1   | 6   |
 |   2 |   2 |     TxD2 |   IN | 0 | 13 || 14 |   |      | 0v       |     |     |
 |   3 |   3 |     CTS2 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO.4   | 4   | 200 |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | IN   | GPIO.5   | 5   | 201 |
 |  64 |  12 |     MOSI |   IN | 0 | 19 || 20 |   |      | 0v       |     |     |
 |  65 |  13 |     MISO |   IN | 0 | 21 || 22 | 0 | IN   | RTS2     | 6   | 1   |
 |  66 |  14 |     SCLK |   IN | 0 | 23 || 24 | 0 | IN   | CE0      | 10  | 67  |
 |     |     |       0v |      |   | 25 || 26 | 0 | IN   | GPIO.11  | 11  | 17  |
 |  19 |  30 |    SDA.1 |   IN | 0 | 27 || 28 | 0 | IN   | SCL.1    | 31  | 18  |
 |  20 |  21 |  GPIO.21 |   IN | 0 | 29 || 30 |   |      | 0v       |     |     |
 |  21 |  22 |  GPIO.22 |   IN | 0 | 31 || 32 | 0 | IN   | RTS1     | 26  | 7   |
 |   8 |  23 |  GPIO.23 |   IN | 1 | 33 || 34 |   |      | 0v       |     |     |
 |  16 |  24 |  GPIO.24 |   IN | 1 | 35 || 36 | 1 | IN   | CTS1     | 27  | 13  |
 |   9 |  25 |  GPIO.25 |   IN | 0 | 37 || 38 | 1 | IN   | TxD1     | 28  | 15  |
 |     |     |       0v |      |   | 39 || 40 | 1 | IN   | RxD1     | 29  | 14  |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+-NanoPI M1+---+------+----------+-----+-----+

 +-----+----NanoPI M1 Debug UART---+----+
 | BCM | wPi |   Name   | Mode | V | Ph |
 +-----+-----+----------+------+---+----+
 |     |     |       0v |      |   | 41 |
 |     |     |       5v |      |   | 42 |
 |   4 |  32 |   GPIO.4 |   IN | 1 | 43 |
 |   5 |  33 |   GPIO.5 |   IN | 1 | 44 |
 +-----+-----+----------+------+---+----+


example usage:

First download and compile wiringnp

make

gpio readall

gpio mode 21 out

gpio mode 22 out

gpio write 21 1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s