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
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