Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(5)  |  Derive(0)  |  Import(5)
simple subclass to support bit-bang mode

Internally uses async mode at the moment, but provides a 'sync'
flag (defaulting to True) which controls the behaviour of port
reading and writing - if set, the FIFOs are ignored (read) or
cleared (write) so operations will appear synchronous

Adds two read/write properties to the base class:
 direction: 8 bit input(0)/output(1) direction control.
 port: 8 bit IO port, as defined by direction.

src/p/y/pylibftdi-0.14.1/pylibftdi/examples/pin_read.py   pylibftdi(Download)
import time
import sys
from pylibftdi import BitBangDevice, ALL_INPUTS
 
 
    """
    if not getattr(get_value, "dev", None):
        get_value.dev = BitBangDevice(direction=ALL_INPUTS)
    dev = getattr(get_value, "dev")
    return dev.port

src/p/y/pylibftdi-0.14.1/pylibftdi/examples/magic_candle.py   pylibftdi(Download)
 
from pylibftdi.util import Bus
from pylibftdi import BitBangDevice
 
 
    def __init__(self):
        # make the device connection, this is used
        # in the Bus descriptors. Also set direction
        # appropriately.
        self.device = BitBangDevice(direction=0xFE)

src/p/y/pylibftdi-0.14.1/pylibftdi/examples/lcd.py   pylibftdi(Download)
"""
 
from pylibftdi import BitBangDevice, Bus
 
 
    an optional `device_id` can be given.
    """
    with BitBangDevice(device_id) as bb:
 
        # These LCDs are quite slow - and the actual baudrate

src/p/y/pylibftdi-0.14.1/pylibftdi/examples/led_flash.py   pylibftdi(Download)
import time
import sys
from pylibftdi import BitBangDevice
 
 
def flash_forever(rate):
    "toggle bit zero at rate Hz"
    # put an LED with 1Kohm or similar series resistor
    # on D0 pin
    with BitBangDevice() as bb:

src/p/y/pylibftdi-0.14.1/pylibftdi/examples/bit_server.py   pylibftdi(Download)
from cStringIO import StringIO
from SocketServer import ThreadingMixIn
from pylibftdi import BitBangDevice
 
HTTP_PORT = 8008
 
if __name__ == '__main__':
    switch = BitBangDevice()
 
    try: