コード例 #1
0
def A2D8Channel(outchan, debugchan=None, blink=True, _process=None):
    """python-csp interface to the Toradex Oak 8 channel A2D.
    """
    debugstring = 'Toradex 8 Channel A2D'
    sensor = ToradexG()
    sensor.open()
    while True:
        if blink: sensor.led_on()
        data = sensor.get_data()[1:]
        if blink: sensor.led_off()
        outchan.write(data)
        if debugchan is not None: debugchan.write(data)
        yield
    return
コード例 #2
0
def Accelerometer(outchan, debugchan=None, blink=True, _process=None):
    """python-csp interface to the Toradex Oak 3-axis accelerometer.
    """
    debugstring = 'Toradex G 3-axis Accelerometer'
    sensor = ToradexG()
    sensor.open()
    while True:
        if blink: sensor.led_on()
        x, y, z = sensor.get_data()[1:]
        if blink: sensor.led_off()
        outchan.write((x, y, z))
        if debugchan is not None: debugchan.write((x, y, z))
        yield
    return
コード例 #3
0
ファイル: toradex_csp.py プロジェクト: JohnReeves/python-csp
def A2D8Channel(outchan, debugchan=None, blink=True, _process=None):
    """python-csp interface to the Toradex Oak 8 channel A2D.
    """
    debugstring = 'Toradex 8 Channel A2D'
    sensor = ToradexG()
    sensor.open()
    while True:
        if blink: sensor.led_on()
        data = sensor.get_data()[1:]
        if blink: sensor.led_off()
        outchan.write(data)
        if debugchan is not None: debugchan.write(data)
        yield
    return
コード例 #4
0
ファイル: toradex_csp.py プロジェクト: JohnReeves/python-csp
def Accelerometer(outchan, debugchan=None, blink=True, _process=None):
    """python-csp interface to the Toradex Oak 3-axis accelerometer.
    """
    debugstring = 'Toradex G 3-axis Accelerometer'
    sensor = ToradexG()
    sensor.open()
    while True:
        if blink: sensor.led_on()
        x, y, z = sensor.get_data()[1:]
        if blink: sensor.led_off()
        outchan.write((x, y, z))
        if debugchan is not None: debugchan.write((x, y, z))
        yield
    return