Re: [Tutor] PYFTDI Library for FT232H

2012-08-03 Thread Mark Lawrence

On 03/08/2012 02:02, Steven D'Aprano wrote:

On 03/08/12 09:38, John Battle wrote:

I am relatively new to Pyton and am trying to use a library called pyftdi
which is used to establish communication with USB chips made by FTDI.
I have
been able to install the library and write a simple piece of code to
discover
my interfaces (I have two FT232H devices connected). The following
code seems
to work to accomplish that:

#!/usr/bin/python
from pyftdi.pyftdi.ftdi import *
vps=[(0x0403,0x6014)]
devs=Ftdi.find_all(vps)
print devs

However I cannot figure out what to do next.



If you are talking about this library:

http://pypi.python.org/pypi/pyftdi

have you tried reading the documentation, such as it is? I've had a
quick look, and it appears to be extremely light on documentation, but I
didn't dig too deeply, maybe you will have better luck. The GitHub page
claims to have some examples, but I couldn't get it to work in my browser.

You can also try this at the Python interactive interpreter:

import pyftdi
help(pyftdi)


and see if the library has any useful embedded documentation. It may not.


Do you know how to start the interactive interpreter? You need to open a
terminal window, then at the prompt, you need to launch Python. Under
Linux, I just type

python

and hit the ENTER key. If you are using Windows, it may be more
complicated.





Just the same for Windows, although I tend to use PythonWin myself.

--
Cheers.

Mark Lawrence.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] PYFTDI Library for FT232H

2012-08-02 Thread John Battle
I am relatively new to Pyton and am trying to use a library called 
pyftdi which is used to establish communication with USB chips made by 
FTDI.  I have been able to install the library and write a simple piece 
of code to discover my interfaces (I have two FT232H devices 
connected).  The following code seems to work to accomplish that:


#!/usr/bin/python
from pyftdi.pyftdi.ftdi import *
vps=[(0x0403,0x6014)]
devs=Ftdi.find_all(vps)
print devs

However I cannot figure out what to do next.  The devices in question 
are programmed n the FT245 Syncronous mode and I need to send a short 
string to one of them to start a data download and then receive straming 
data on the other one.


I have a C program that will do this but I need to do it in Python.

Any help would be gretly appreciated.

Thanks

John Battle



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] PYFTDI Library for FT232H

2012-08-02 Thread Alan Gauld

On 03/08/12 00:38, John Battle wrote:

I am relatively new to Pyton and am trying to use a library called
pyftdi which is used to establish communication with USB chips


This list is really for those learning the core Python language and 
standard library. Although we do cover some common third party libraries 
too it's not really our purpose.


You might be very lucky and find someone who knows this particular 
library but you will generally have better success on a support forum 
for the library or by writing the author directly. Failing that you 
could try the main Python mailing list/newsgroup.



I have a C program that will do this but I need to do it in Python.


If it's simply how to translate the C to Python we might be able to 
help. If you can post a short example of the C that you want to

emulate we may be able to help with that.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] PYFTDI Library for FT232H

2012-08-02 Thread Steven D'Aprano

On 03/08/12 09:38, John Battle wrote:

I am relatively new to Pyton and am trying to use a library called pyftdi
which is used to establish communication with USB chips made by FTDI. I have
been able to install the library and write a simple piece of code to discover
my interfaces (I have two FT232H devices connected). The following code seems
to work to accomplish that:

#!/usr/bin/python
from pyftdi.pyftdi.ftdi import *
vps=[(0x0403,0x6014)]
devs=Ftdi.find_all(vps)
print devs

However I cannot figure out what to do next.



If you are talking about this library:

http://pypi.python.org/pypi/pyftdi

have you tried reading the documentation, such as it is? I've had a quick 
look, and it appears to be extremely light on documentation, but I didn't dig 
too deeply, maybe you will have better luck. The GitHub page claims to have 
some examples, but I couldn't get it to work in my browser.


You can also try this at the Python interactive interpreter:

import pyftdi
help(pyftdi)


and see if the library has any useful embedded documentation. It may not.


Do you know how to start the interactive interpreter? You need to open a 
terminal window, then at the prompt, you need to launch Python. Under Linux, I 
just type


python

and hit the ENTER key. If you are using Windows, it may be more complicated.



--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor