Placing triggers in data with button press
Hi all,
I need to send triggers to mark external events while recording with the OpenBCI. Eg, to mark eyes open, eyes closed, and a variety of other subjective states.
I understand that you can just use the PROG button the OpenBCI board for this?
I have had a search around the tutorials and forum, but am still a little in the dark about this.
I understand that with the most recent firmware (I bought my OpenBCI Cyton in August 2017) there is no need to program the board, and that it will be able to read button pushes without adding further code?
In this case, can you just press the PROG button and a channel will register that button press???
Can anyone point me in the right direction on this, I really need a bit more instruction that I can see on the tutorial.
Also, ideally, I would have an external button box. I will look into this.
I see this tutorial on external button boxes:
But that button box seems to need an external power supply, which is not recommended.
Is there an alternative way of creating and using an external button box to send triggers, which is safer and easier than bunging your finger into the boards PROG button any time something happens?
Thanks in advance folks!
Comments
Update your cyton firmware to 3.1.0 and you can do this from the new 3.2.0 GUI at the click of the button!
Here is a tweet with a photo of what it looks like
With the press of a button you can read from five digtial IO pins, one of which D17, is hooked up to the PROG button!!!!!
Also you can hook up an external button to any of the other inputs as well, there are four others.
This marker is automatically entered into the openbci output data file.
I would love a contribution from you as an update to the docs page you posted so we can teach others how to do this!
v3.1.0 Cyton Firmware: https://github.com/OpenBCI/OpenBCI_32bit_Library/releases/tag/v3.1.0
Cyton programming tutorial: http://docs.openbci.com/Hardware/05-Cyton_Board_Programming_Tutorial
v3.2.0 OpenBCI GUI: https://github.com/OpenBCI/OpenBCI_GUI/releases/tag/v3.2.0
Installing the OpenBCI GUI tutorial: http://docs.openbci.com/OpenBCI Software/01-OpenBCI_GUI
No. You should open an issue for this I think.
> Please let me know if this is the correct method to go about this, or if I need to take additional steps.
Your setup is good. I had trouble following the "step 2". I'm a visual learner so send a diagram if you want! Maybe use an SD card as well so you can ensure that you don't loose any data in-case a packet is dropped over the air.
> I am really keen to start using triggers in my data
Go for it! You may have to update your firmware, I would assume yours is out of date.
>
I thought from what you had written that you actually physically press
the PROG button on the Cyton board? Is that the case?
> If so, where in the data are the triggers latter to be found?
They are sent with the actual sample data, where the accelerometer normally goes. They will be extracted into the output data file in the GUI too.
> Lastly, how do I find out what firmware version I have?
You should use the terminal on Arduino to send a 'v' and the version will be returned in the serial terminal. https://learn.sparkfun.com/tutorials/terminal-basics/arduino-serial-monitor-windows-mac-linux
> You mention five digtial IO pins, one of which D17. Can you explain how this relates to the 12 pins on the Cyton board? (eg, N1 to N8, plus SRB, BIAS etc?)
They are located on the top of the board and are accessible via the black headers on the lower right side of the board if you were looking top down at your Cyton!
> I recorded some EEG while pressing the PROG button, but don't see any clear triggers in the data.
Did you change the board mode with the GUI?
push of the PROG button, and the resulting trigger being placed in the
data?
You need to change your serial port driver settings! Check around the forum for the numerous other times people have had to do this for your Opersting System. You wan tot lower your latency down to 64ms from 500ms and that lag will disapear!
That button press is recorded with the next time a sample is read though, so it's entered into the stream at the right time.
@zhanglei well are you looking at raw output from the GUI? where there are only eight channels each row and two rows make a 16 channel sample? If that is the case then the button is held down for 200ms which sounds like a fast button press. If you really want to verify this, hook up an arduino of something similar to the digital input and hold the pin high for 8 ms and then send the pin low.
I posted a new guide for triggers and will add in some screen shots tomorrow
http://docs.openbci.com/Tutorials/06-External_Trigger_Cyton_Example
If you want to see this three then you simply need to connect to either D11, D12, D13, D17 or D18. As in you can see up to five!
Does this make sense?