DataHub: Difference between revisions
Jump to navigation
Jump to search
Wiki-admin (talk | contribs) |
Wiki-admin (talk | contribs) |
||
| Line 57: | Line 57: | ||
#!/usr/bin/env python | #!/usr/bin/env python | ||
import threading | |||
from | from pylsl import StreamInfo, StreamOutlet | ||
def getData(): | |||
while running: | |||
buffer_in = getSensorData() | |||
send_data = True | |||
time.sleep(0.001) | |||
info = StreamInfo( | |||
name='MyStream', | |||
type='COP', | |||
channel_count=4, | |||
nominal_srate = 200, | |||
source_id='BalanceBoard_stream' | |||
) | |||
outlet = StreamOutlet(info) | |||
threading.Thread(target=getData).start() | |||
while running == True: | |||
if send_data: | |||
outlet.push_chunk(buffer_in) | |||
send_data = False | |||
==References== | ==References== | ||