How to get EMG Data from the OpenBCI GUI Widget in Python
in Cyton
Hi guys,
I have a OpenBCI Cyton Board with an EMG electrode at N1P. I see amazing data in the OpenBCI GUI EMG Widget and I would like to use that data to perform actions. How can I get that data into my python console so I can use it for programming.
Comments
Hi, Aarav,
The easiest route is generally to skip the GUI and have your Python access the Cyton data stream directly using Brainflow library. Examples on this page:
https://brainflow.org/
https://brainflow.readthedocs.io/en/stable/Examples.html#python
The GUI does have a 'networking widget', but this will probably be more work than the direct Brainflow access:
https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#networking
GUI Networking Widget Guide document:
https://docs.google.com/document/u/1/d/e/2PACX-1vR_4DXPTh1nuiOwWKwIZN3NkGP3kRwpP4Hu6fQmy3jRAOaydOuEI1jket6V4V6PG4yIG15H1N7oFfdV/pub
Regards, William
Hi Wjcroft,
Thanks for your response. I already managed to get Brainflow connected and got the real time plot example to work (would this help?)
Is it possible to just get the EMG Data directly through the Brainflow Library though?
Brainflow is ALREADY giving you the raw signal from your EMG channel(s). It is up to you if you want to process it in some way to emulate the EMG widget in the GUI. Here is the GUI widget source code:
https://github.com/OpenBCI/OpenBCI_GUI/blob/master/OpenBCI_GUI/W_EMG.pde
https://github.com/OpenBCI/OpenBCI_GUI/blob/master/OpenBCI_GUI/W_EMGJoystick.pde
As previously mentioned, the GUI EMG widget (and EMG joystick) can output some values via the Networking widget. See the lines mentioning EMG in this document:
https://docs.google.com/document/u/1/d/e/2PACX-1vR_4DXPTh1nuiOwWKwIZN3NkGP3kRwpP4Hu6fQmy3jRAOaydOuEI1jket6V4V6PG4yIG15H1N7oFfdV/pub