Cyton defaults referential, or differential like Ganglion? / Python command automation
"Basic usage
The startStreaming function of the Board object takes a callback function and begins streaming data from the board. Each packet it receives is then parsed as an OpenBCISample which is passed to the callback function as an argument.
OpenBCISample members: -id: int from 0-255. Used to tell if packets were skipped.
-channel_data: 8 int array with current voltage value of each channel (1-8)
-aux_data: 3 int array with current auxiliary data. (0s by default)"
but it doesn't disclose whether the potentials at each channel are in reference to a common reference (SRB2) or whether they are referenced to the N and P of each respective channel.
I'm sure with some digging/experimenting this can be figured out, but if someone had this information so that I could skip a few steps, I'd really appreciate it!
Best,
Mike
Comments
However, since the code is not constantly checking for a change in "s" (presumably where I'd feed in channel setting commands), is it possible to force communication with the board to change these settings directly (before or after starting to stream?)? There seems to be a "board" object called with multiple functions (an example being boardThread = threading.Thread(target=board.start_streaming, args=(fun, lapse))), is it possible to send the channel setting commands directly to board?
for c in s:
if sys.hexversion > 0x03000000:
board.ser.write(bytes(c, 'utf-8'))
print('writing utf-8')
else:
board.ser.write(bytes(c))
print('writing alternative')
time.sleep(0.100)
to be before starting the streaming thread but after defining the channel settings.
Truthfully, it isn't a fix the Python developers should implement. Although my solution does work, it's far from ideal. The correct solution would have been to change the default channel settings during initialization. In order to avoid having to modify the Cyton firmware the Python hack was my work around.
If anyone wants the details feel free to contact me and I'll post what I did. I should note that the key to changing the settings through the user.py file was to use board.ser.write(bytes(c)) where c is the command to the board. You can verify that the commands were received through the board.ser.read while loop that is used at the end of the user class. Also,make sure to place the ser.write fnxn must be placed after the board thread has been started!