Using left and right mouse clicks as external triggers

nushaabnushaab Toronto, ON
edited March 2022 in Cyton

Hello,

I am looking to integrate OpenBCI with an existing visual choice preference experiment in which a left or right mouse click, corresponding to a choice between a left or right image, will also send a triggers to OpenBCI/OpenBCI GUI. I'm not sure of the possibility of this working, but there is a Mouse function in Arduino that allows for mouse inputs to be used (https://www.arduino.cc/reference/en/language/functions/usb/mouse/mouseispressed/). Would it be possible to use this function with the OpenBCI board or is this not compatible with chipKIT boards?

Additionally, I looked into the pushbutton trigger code as an example, which uses digital read (https://github.com/openbci-archive/OpenBCI_Button_Trigger), but I cannot seem to find the tutorial that it initially led to as the link is now invalid (http://docs.openbci.com/tutorials/05-External_Trigger_32bit_Example).

I would appreciate any insight into this, as this would greatly enhance the experiment!

Thanks in advance,

Nushaab

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hi Nushaab,

    Have you seen this tutorial that connects two external buttons to the Cyton board, using pins D17 and D18? It is NOT using "mouse clicks" to record the presses along with the EEG stream. But instead two external buttons that you wire up using a breadboard and switches.

    https://irenevigueguix.wordpress.com/2016/05/03/two-external-buttons-on-openbci-32bit-board/

    Just a note on what happened when I visited that page. Initially all the images were gone. And stayed that way for some period of time (minutes?) Eventually the images did appear. So my guess is that this is some glitch on the web server involved. Perhaps Irene @viguix could look into that. Here are some other related pages,

    https://openbci.com/community/two-external-buttons-on-openbci-32bit-board/
    https://github.com/viguix/2ExternalButtons

    Regards, William

  • wjcroftwjcroft Mount Shasta, CA

    Note with that tutorial, it predated the ability of the Cyton firmware to record the external pin status, in either analog or digital mode. These are called 'analog read mode' or 'digital read mode' in the documentation.

    https://docs.openbci.com/Cyton/CytonExternal/#external-triggering-the-easy-way-firmware-3xx

    So the bottom line is, you don't need any of the firmware changes that Irene mentions on her tutorial. Only her breadboard / switch setup. Use the appropriate OpenBCI_GUI widget (digital or analog read mode) to include the switch data in the Aux data fields of the samples.

    William

  • wjcroftwjcroft Mount Shasta, CA

    When the PIC32 processor reads pins in 'digital' mode, it is checking for logic voltage values of 0V (false), and 3.3V (true). You will probably want to use digital read mode in the Widget. Alternately, in 'analog' mode, the pins actually sample an analog voltage value, as a 10 bit number from 0 to 1023. With 0V = 0, and 3.3V = 1023.

    The two button breadboard tutorial just has two voltage output values, 0V or 3.3V, depending on whether the pin is connected to the Vdd pin, or to ground.

Sign In or Register to comment.