Raspberry pi 2

Hi guys I am using the bcm2835 library to program my raspberry pi 2. I cannot find a diagram of the different pins I want to program. Do any of you know of such a diagram that would label the different pins?

you mean this?

That looks like it but I am not sure why this doesn't work
#define PIN0 RPI_GPIO_P1_3

Once I looked at your post, then at the diagram, then at your post again...then I laughed.

3 Likes

why is that?

@shu_kaze most likely laughed because you wanted the coding side of the pins and to program each pin not so much the physical pin out on the board itself.

Example code that came with the library kind of corresponded with the above diagram. It says that pin 17 is pin 11 so I could use #define PIN RPI_GPIO_P1_11 in the comments of the code.

@chiefshane If you cannot make sense of the diagram then I will just put this here for you: https://www.raspberrypi.org/documentation/usage/gpio/

I understand the numbering system but I am unable to program any pins under 11.

Under pin 11, you can only program pin 3, 5 and 7. Pins 8 and 10 are for serial transmission. Can you check to see if you have access to those pins?

Plus the pin numbering and the digital numbering are different:

I cant program any pin under 11.

Ok, are you using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM) ?

I am using a c library called bcm2835.

But your running python for this right?

no I am using C.

I cannot help you then. Sorry.

Most likely you'll need to disable a peripheral to use pins that are used for serial, spi, or i2c.

I haven't used that lib in a while but there's prolly a function/macro that will bypass the hardware peripherals so you can just set it manually.

found the problem its not #define PIN27 RPI_GPIO_P1_3 its #define PIN27 RPI_GPIO_P1_03 lol