Hardware Reference
In-Depth Information
Displaying GPIO Settings
The following command can be used to display your GPIO settings:
$ gpio readall
+----------+--------+---------+-------+-------+
| wiringPi | GPIO | Name | Mode | Value|
+----------+--------+---------+-------+-------+
| 0 | 17 | GPIO 0 | IN | High |
| 1 | 18 | GPIO 1 | IN | Low |
| 2 | 27 | GPIO 2 | OUT | Low |
| 3 | 22 | GPIO 3 | IN | Low |
| 4 | 23 | GPIO 4 | IN | Low |
| 5 | 24 | GPIO 5 | IN | Low |
| 6 | 25 | GPIO 6 | IN | Low |
| 7 | 4 | GPIO 7 | IN | Low |
| 8 | 2 | SDA | ALT0 | High |
| 9 | 3 | SCL | ALT0 | High |
| 10 | 8 | CE0 | IN | Low |
| 11 | 7 | CE1 | IN | Low |
| 12 | 10 | MOSI | IN | Low |
| 13 | 9 | MISO | IN | Low |
| 14 | 11 | SCLK | IN | Low |
| 15 | 14 | TxD | ALT0 | High |
| 16 | 15 | RxD | ALT0 | High |
| 17 | 28 | GPIO8 | IN | Low |
| 18 | 29 | GPIO9 | IN | Low |
| 19 | 30 | GPIO10 | IN | Low |
| 20 | 31 | GPIO11 | IN | Low |
+----------+--------+---------+-------+-------+
Reading GPIO
As a convenience, the gpio command allows you to read values from the command line:
$ gpio export 27 in
$ gpio −g read 27
0
$ gpio unexportall
Use the -g option to specify that the pin number is a GPIO pin number. (I found the
need for the -g option irksome.)
 
Search WWH ::




Custom Search