QMESAR
Posts: 29
Joined: Wed Sep 06, 2017 10:41 am

Finding the correct docs

Tue Sep 19, 2017 5:17 pm

Hi All.

I apologize for this question however I have spend some time on the web to find the documentation for the following with limited success
(1) the GPIO library
(2) SPI Library

I would like to look what functions are available for use in the libraries .I am very new to this and only got a LED to blink so far from an example program :D :oops:

I appreciate any help or guidance

Kind Regards
QMESAR

User avatar
DougieLawson
Posts: 29766
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Finding the correct docs

Tue Sep 19, 2017 7:24 pm

Which GPIO library? Which SPI library? There's a gazillion of them.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4075
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Finding the correct docs

Tue Sep 19, 2017 7:38 pm

QMESAR wrote: Hi All.
I apologize for this question however I have spend some time on the web to find the documentation for the following with limited success
(1) the GPIO library
(2) SPI Library
I would like to look what functions are available for use in the libraries .I am very new to this and only got a LED to blink so far from an example program :D :oops:
I appreciate any help or guidance
Kind Regards
QMESAR
What programming language are you looking for the (library) docs. you need? Have you looked for any "README" files within (library) source code (if provided)?
For example, I'm primarily a 'C' programmer and mainly use wiringPi or pigpio libraries, around which I often "wrap" additional diagnostic code. Their documentation is mainly located on their respective authors websites plus additional, internal notes within the source code. My 'C' demo. code** also contains similar, internal, source documentation relating to the specific hardware setups being "demonstrated" and simple, self-generated "help".
Trev.
** FWIW, see here: http://www.cpmspectrepi.uk/raspberry_pi ... tware.html
Usually running Raspbian Jessie on up to 12 of 13 Pi's (an A, B1, 2xB2, 2xB+, A+, P2B, 3xP0, P0W) and Stretch on my P3B. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

QMESAR
Posts: 29
Joined: Wed Sep 06, 2017 10:41 am

Re: Finding the correct docs

Wed Sep 20, 2017 4:17 am

FTrevorGowen wrote:
Tue Sep 19, 2017 7:38 pm
What programming language are you looking for the (library) docs. you need? Have you looked for any "README" files within (library) source code (if provided)?
Dear Mr FTrevorGowan,

I have to admit starting out with this RPI world is not so easy as it is a Huge topic with millions of SW packages and things as beginner you do not even see the leaves from the trees,a person does not know what to use !

The sample code a person find mostly on the web is code snippets and there is no information about it such as you are describing ,I would not say it does not exist however I do not even know where to start to search .

I am trying to learn Paython and I bought the books from Prof Dogan Ibrahim and Bert van Dam as learning resources however besides that they use Raspbian ,Bash and Nano and a bunch of sample projects with code it does not give the information on what Libraries they are using and where to find the information for the libraries they are using.

I did the sample project to blink an LED from GPIO18 with the Import RRi.GPIO as GPIO as you will see from the code snippet attached
and it also uses the time library so where do I get or find more information about these things also ,I would like to control some sensors and IC's over SPI in future but if I understand the replies correctly that there are a number of SPI Libraries so how does a person decide what to use.
It is clear to me that somewhere there must be a description for these function call the code does .
What I would like to do is to use Libraries that is recommended by RPI foundation and not using some stuff found on the internet .
I really hope I could explain my problem .

Again thank you all for your replies it just made me realize this is a pot of worms I opened up starting to work with Rpi at the moment it seems there are millions of different Linux packages millions of Libraries and nobody know what to use or is the safest way to go :oops: or even where to find the documentation for the packages you use besides that a beginner does not even know what he is using.

Code: Select all

import Rpi.GPIO as GPIO 			#import GPIO module
import time 						#import time module

LED = 18
ON = 1
OFF = 0

GPIO.setmode(GPIO,BCM)		     #set BCM pin numbering

GPIO.setup(LED,GPIO.OUT)	     #configure CH 18 as output

for i in range (0,10):				 
      GPIO.output(LED,ON)			
      time.sleep(1)                                
      GPIO.output(LED,OFF)			 
      time.sleep(1)                                  
     
 GPIO.cleanup()                    # cleanup


User avatar
KLL
Posts: 1056
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Finding the correct docs

Wed Sep 20, 2017 4:42 am

you possibly mean like:
https://docs.python.org/3.5/library/index.html
and specific for time lib ( for python 3.5 )
https://docs.python.org/3.5/library/time.html

but as long all you tell us is
I am trying to learn Paython
and you post a code but not what it is and how you run it
it is still not clear / we need to guess / what you talk about.

QMESAR
Posts: 29
Joined: Wed Sep 06, 2017 10:41 am

Re: Finding the correct docs

Wed Sep 20, 2017 5:08 am

and you post a code but not what it is and how you run it
Thank you for the reply .I fail to see what this has to do with the document that tells me how to use the RPI.GPIO library
as I also mentioned in my post I ran it successfully ,the code is working however in my explanation I tried to show with the code which library document I am looking for as other posters told that I need to show which library I am using and as mentioned I have no clue as it is code from a technical learning book .
it is still not clear / we need to guess / what you talk about.
I did the sample project to blink an LED from GPIO18 with the Import RRi.GPIO as GPIO as you will see from the code snippet attached
and it also uses the time library so where do I get or find more information about these things
I do not know how to explain what I am looking for more that I did sorry if my english makes no sense

Any case I ran this code example with python 3 from the terminal and it is working fine

Thank you again for your reply and the links I will dig into them today :D

Kind Regards
QMESAR
Last edited by QMESAR on Wed Sep 20, 2017 5:47 am, edited 1 time in total.

User avatar
KLL
Posts: 1056
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Finding the correct docs

Wed Sep 20, 2017 5:22 am

your english is better than mine, i think that is not the point,

it is the question / here and at google / what was not clear
a library is for a programming language so you must say
python3 RPI.GPIO https://www.google.co.th/search?q=python3+RPI.GPIO

https://pypi.python.org/pypi/RPi.GPIO
https://sourceforge.net/p/raspberry-gpi ... wiki/Home/
Last edited by KLL on Wed Sep 20, 2017 6:42 am, edited 1 time in total.

QMESAR
Posts: 29
Joined: Wed Sep 06, 2017 10:41 am

Re: Finding the correct docs

Wed Sep 20, 2017 5:57 am

Thank you KLL for your links, I will look into them and see if this all can make some sense to me
It is quite confusing at the moment.
Again I appreciate your efforts to help out :D

Return to “Beginners”

Who is online

Users browsing this forum: apoldion, JackMauro and 38 guests