Changes

Jump to navigation Jump to search
98 bytes removed ,  16:12, 1 February 2022
no edit summary
Line 27: Line 27:  
     | downloads          =  
 
     | downloads          =  
 
     | manuals            = {{bulleted list
 
     | manuals            = {{bulleted list
         | [https://docs.unity3d.com/Manual/index.html Official Documentation]
+
         | [https://docs.openbci.com/ Documentation]
 +
        | [https://sccn.ucsd.edu/~mgrivich/LSL_Validation.html LSL Validation]
 +
        | [https://labstreaminglayer.readthedocs.io/info/supported_devices.html Supported Devices and Tools]
 +
    }}
 +
    | header2            = Templates
 +
    | data2              = {{bulleted list
 +
        | [https://surfdrive.surf.nl/files/index.php/s/qggfMMKsnUIDO0k example scripts (zip)]
 
     }}
 
     }}
 
   }}
 
   }}
Line 83: Line 89:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
A short example for sending lsl streaming data:
+
A short example for receiving lsl data:
 
<syntaxhighlight lang="python" line>
 
<syntaxhighlight lang="python" line>
 
#!/usr/bin/env python
 
#!/usr/bin/env python
   −
import threading
+
from pylsl import StreamInlet, resolve_stream
from pylsl import StreamInfo, StreamOutlet
     −
def getData():
+
streams = resolve_stream('name', 'MyStream')
    while running:
+
#streams = resolve_streams()
        buffer_in = getSensorData()
  −
        send_data = True
  −
        time.sleep(0.001)
     −
info = StreamInfo(
+
inlet = StreamInlet(streams[0])
    name='MyStream',
+
while True:
    type='COP',
+
     sample, timestamp = inlet.pull_sample()
    channel_count=4,
+
    print(timestamp, sample)
     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
   
</syntaxhighlight>
 
</syntaxhighlight>
  −
==References==
  −
<references />
  −
  −
==External Links== <!-- Optional -->
  −
*{{Official website|https://unity3d.com}}
  −
*[https://docs.unity3d.com/Manual/index.html Official Documentation]
 

Navigation menu