thamaeng
Posts: 24
Joined: Fri Oct 10, 2014 12:48 pm

GPIO define

Mon Nov 17, 2014 5:32 pm

hey,
when defining GPIO ports do we have to consider the actual pin in raspberry pi or the GPIO number. for example if im using pin 40 opposite to the pin 39(GND) with LCD, should i say LCD_RS = 40 or LCD_RS = 21 ?

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO define

Mon Nov 17, 2014 5:46 pm

You have to use the numbers recognised by the software you are using.

Some software use pin numbers (physical pin number on expansion header), some use Broadcom gpio number, and some use their own numbering scheme.

thamaeng
Posts: 24
Joined: Fri Oct 10, 2014 12:48 pm

Re: GPIO define

Mon Nov 17, 2014 5:50 pm

i am trying to connect a 16x2 lcd display. normally i write the program by typing nano filename. is this what did you mean by software?
Last edited by thamaeng on Mon Nov 17, 2014 5:55 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO define

Mon Nov 17, 2014 5:52 pm

thamaeng wrote:i am using raspian. and using nano to write the program.
That is 100% irrelevant. Please re-read Joan's answer.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

thamaeng
Posts: 24
Joined: Fri Oct 10, 2014 12:48 pm

Re: GPIO define

Mon Nov 17, 2014 5:57 pm

DougieLawson wrote:
thamaeng wrote:i am using raspian. and using nano to write the program.
That is 100% irrelevant. Please re-read Joan's answer.

please do you mind explaining his question.

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO define

Mon Nov 17, 2014 6:01 pm

What software is going to use the value of LCD_RS?

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: GPIO define

Mon Nov 17, 2014 7:04 pm

Are you writing C software or Python or something else?

If you are not sure, could you post a few lines of the code here, in code tags.

Return to “Beginners”