I've always thought SEO was evil (in the non-theological sense!), but this effort (via @rem) seems well worth supporting. According to my Facebook page my favourite quote is 'It is amazing what you can accomplish if you do not care who gets the credit' - so said Harry Truman. Perhaps amazing is overstating the goal, but maybe it could be paraphrased 'It is amazing what you can make Google do if it is actually helpful and not (directly) self-serving'. I guess we'll find out...
Sunday 26 September 2010
Sunday 19 September 2010
Announcing pylibftdi - a minimal Pythonic wrapper for libftdi
[edit 2013-11-25: note that recent versions of pylibftdi have deprecated and then removed the ability to use 'Driver' in this way; replace Driver
and BitBangDriver
with Device
and BitBangDevice
in the code below]
Toggling an LED or other device from pin D0
from pylibftdi import BitBangDriver
import time
with BitBangDriver() as bb:
while True:
bb.port ^= 1
time.sleep(0.5)
Sending a string to a serial terminal
from pylibftdi import Driver
with Driver() as drv:
drv.baudrate = 19200
drv.write('Hello World!')
It's been tested on Linux (Ubuntu 10.10) and Mac OS X (10.6), with libftdi 0.17 and 0.18, but doesn't have any intended platform specific requirements other than having the libftdi library installed.
The following goals for this project differentiate it from similar projects:
- Fully supported on Linux and Mac OS X, using Intra2net's open source libftdi driver.
- Simple things are very simple, as the example above shows. The basic functionality is made as simple as possible to use, with properties and context managers used where it makes sense. Most other FTDI Python wrappers are 'just' low level bindings of the underlying API.
- There will be an increasing library of examples showing interaction with various protocols and devices - note this is a goal, not yet an accomplishment, though there is an LCD example there.
For reference, other similar projects include PyUSB, pyftdi, python-ftdi, and ftd2xx. There are probably others...
Subscribe to:
Posts (Atom)