Skip to content

Instantly share code, notes, and snippets.

@duytan90
Last active August 27, 2018 03:50
EmotivBCI - Mental Commands keyboard

EmotivBCI - Mental Commands keyboard example:

This flow allows you to use Mental Commands to simulate pressing a keystroke.

How to import example:

To import this example to Node-RED:

  1. Start Node-RED in your Terminal or cmd window
  2. On your web-browser, go to http://127.0.0.1:1880 to open Node-RED
  3. On the top-right screen, go to Menu/Import/Clipboard and paste the contents of the JSON file below in "example directory".
  4. This examples requires: On cmd/terminal, go to ~/.node-red and enter these commands (local install):
    a. EmotivBCI Node-RED Toolbox: $ npm install node-red-contrib-emotiv-emotiv-bci
    b. EMOTIV keyboard node: $ npm install node-red-contrib-emotiv-keyboard

Since all BCI Node-Red flows and other Emotiv applications share one instance of Cortex Service, so you should only run/deploy one flow at a time.

[
{
"id" : "75df1c9c.f9f274",
"type" : "debug",
"z" : "eeda7784.3e2cd8",
"name" : "",
"active" : true,
"tosidebar": true,
"console" : false,
"tostatus" : false,
"complete" : "false",
"x" : 870,
"y" : 300,
"wires" : []
},
{
"id" : "29334321.88b60c",
"type" : "switch",
"z" : "eeda7784.3e2cd8",
"name" : "Threshold 50",
"property" : "payload",
"propertyType": "msg",
"rules" : [
{
"t" : "gt",
"v" : "50",
"vt": "str"
}
],
"checkall": "true",
"repair" : false,
"outputs" : 1,
"x" : 650,
"y" : 120,
"wires" : [
[
"7caa2f8d.6347",
"9e46319b.ec7f"
]
]
},
{
"id" : "7caa2f8d.6347",
"type" : "debug",
"z" : "eeda7784.3e2cd8",
"name" : "",
"active" : true,
"tosidebar": true,
"console" : false,
"tostatus" : false,
"complete" : "false",
"x" : 870,
"y" : 160,
"wires" : []
},
{
"id" : "7c2aa7c.b960158",
"type" : "switch",
"z" : "eeda7784.3e2cd8",
"name" : "Threshold 50",
"property" : "payload",
"propertyType": "msg",
"rules" : [
{
"t" : "gt",
"v" : "50",
"vt": "str"
}
],
"checkall": "true",
"repair" : false,
"outputs" : 1,
"x" : 650,
"y" : 260,
"wires" : [
[
"75df1c9c.f9f274",
"81c13104.b38a9"
]
]
},
{
"id" : "337378d7.7c7328",
"type" : "EMOTIV",
"z" : "eeda7784.3e2cd8",
"name" : "EMOTIV",
"x" : 120,
"y" : 120,
"wires": [
[
"13b9e855.55e2b8"
]
]
},
{
"id" : "13b9e855.55e2b8",
"type" : "Profile-Name",
"z" : "eeda7784.3e2cd8",
"name" : "Profile Name",
"profileName": "",
"x" : 200,
"y" : 180,
"wires" : [
[
"3de480bf.41b19",
"98aa2d1e.0320c"
]
]
},
{
"id" : "3de480bf.41b19",
"type" : "Mental-Command",
"z" : "eeda7784.3e2cd8",
"name" : "Mental Commands",
"actionName": "push",
"mcSen" : "10",
"x" : 430,
"y" : 120,
"wires" : [
[
"29334321.88b60c"
]
]
},
{
"id" : "98aa2d1e.0320c",
"type" : "Mental-Command",
"z" : "eeda7784.3e2cd8",
"name" : "Mental Commands",
"actionName": "pull",
"mcSen" : "10",
"x" : 430,
"y" : 260,
"wires" : [
[
"7c2aa7c.b960158"
]
]
},
{
"id" : "9e46319b.ec7f",
"type" : "Keyboards",
"z" : "eeda7784.3e2cd8",
"name" : "Keyboards",
"key" : "a",
"typePress": "press",
"x" : 890,
"y" : 80,
"wires" : []
},
{
"id" : "81c13104.b38a9",
"type" : "Keyboards",
"z" : "eeda7784.3e2cd8",
"name" : "Keyboards",
"key" : "w",
"typePress": "press",
"x" : 890,
"y" : 220,
"wires" : []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment