Thursday 1 January 2015

Raspberry Pi B+ Controlling the GPIO with wiringPi

To use the pins with C code, you need wiring Pi,
then to work out which pin is what on a b+ and which pin it matches in wiringPi was not obvious for me.

first run gpio readall,
match you physical  eg pin 8 , which is GPIO 14  but for wiringPi is 14

+-----+-----+---------+------+---+--B Plus--+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
|   4 |       7 |     GPIO. 7 |   IN | 0 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |

No comments:

Post a Comment