Hey everyone, I'm trying to get readings from my Force Trainer II headset using the brain grapher and Arduino brain library.
The BrainSerialTest file is uploading just fine, but I'm not getting a serial output, and the connection to the headset is good (T-pin connected as well as ground).
When I try to run the BrainGrapher.pde I keep getting the error shown below. If anyone could offer some explanation or a solution it would be greatly appreciated.
ERROR MESSAGES
Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"
BrainGrapher:9:1: error: 'import' does not name a type
import processing.serial.;
^
BrainGrapher:10:1: error: 'import' does not name a type
import controlP5.;
^
BrainGrapher:12:1: error: 'ControlP5' does not name a type
ControlP5 controlP5;
^
BrainGrapher:14:1: error: 'Serial' does not name a type
Serial serial;
^
BrainGrapher:16:1: error: 'Channel' does not name a type
Channel[] channels = new Channel[11];
^
BrainGrapher:17:1: error: 'Monitor' does not name a type
Monitor[] monitors = new Monitor[10];
^
BrainGrapher:18:1: error: 'Graph' does not name a type
Graph graph;
^
BrainGrapher:19:1: error: 'ConnectionLight' does not name a type
ConnectionLight connectionLight;
^
BrainGrapher:118:18: error: variable or field 'serialEvent' declared void
void serialEvent(Serial p) {
^
BrainGrapher:118:25: error: expected ')' before 'p'
void serialEvent(Serial p) {
^
/Users/dorian/Downloads/kitschpatrol-BrainGrapher-31cc148/BrainGrapher/BrainGrapher.pde: In function 'void setup()':
BrainGrapher:27:17: error: 'size' was not declared in this scope
size(1024, 768);
^
BrainGrapher:28:15: error: 'frameRate' was not declared in this scope
frameRate(60);
^
BrainGrapher:29:10: error: 'smooth' was not declared in this scope
smooth();
^
BrainGrapher:30:3: error: 'surface' was not declared in this scope
surface.setTitle("Processing Brain Grapher");
^
BrainGrapher:33:69: error: 'println' was not declared in this scope
println("Find your Arduino in the list below, note its [index]:\n");
^
BrainGrapher:35:30: error: 'class HardwareSerial' has no member named 'list'
for (int i = 0; i < Serial.list().length; i++) {
^
BrainGrapher:36:23: error: invalid operands of types 'const char*' and 'const char [3]' to binary 'operator+'
println("[" + i + "] " + Serial.list());
- ^*
BrainGrapher:36:37: error: 'class HardwareSerial' has no member named 'list'
_ println("[" + i + "] " + Serial.list());_
* ^*
BrainGrapher:40:3: error: 'serial' was not declared in this scope
* serial = new Serial(this, Serial.list()[0], 9600);*
* ^*
BrainGrapher:40:16: error: expected type-specifier before 'Serial'
* serial = new Serial(this, Serial.list()[0], 9600);*
* ^*
BrainGrapher:45:3: error: 'controlP5' was not declared in this scope
* controlP5 = new ControlP5(this);*
* ^*
BrainGrapher:45:19: error: expected type-specifier before 'ControlP5'
* controlP5 = new ControlP5(this);*
* ^*
BrainGrapher:47:39: error: 'color' was not declared in this scope
* controlP5.setColorValueLabel(color(0));*
* ^*
BrainGrapher:55:3: error: 'channels' was not declared in this scope
* channels[0] = new Channel("Signal Quality", color(0), "");*
* ^*
BrainGrapher:55:21: error: expected type-specifier before 'Channel'
* channels[0] = new Channel("Signal Quality", color(0), "");*
* ^*
BrainGrapher:56:21: error: expected type-specifier before 'Channel'
* channels[1] = new Channel("Attention", color(100), "");*
* ^*
BrainGrapher:57:21: error: expected type-specifier before 'Channel'
* channels[2] = new Channel("Meditation", color(50), "");*
* ^*
BrainGrapher:58:21: error: expected type-specifier before 'Channel'
* channels[3] = new Channel("Delta", color(219, 211, 42), "Dreamless Sleep");*
* ^*
BrainGrapher:59:21: error: expected type-specifier before 'Channel'
* channels[4] = new Channel("Theta", color(245, 80, 71), "Drowsy");*
* ^*
BrainGrapher:60:21: error: expected type-specifier before 'Channel'
* channels[5] = new Channel("Low Alpha", color(237, 0, 119), "Relaxed");*
* ^*
BrainGrapher:61:21: error: expected type-specifier before 'Channel'
* channels[6] = new Channel("High Alpha", color(212, 0, 149), "Relaxed");*
* ^*
BrainGrapher:62:21: error: expected type-specifier before 'Channel'
* channels[7] = new Channel("Low Beta", color(158, 18, 188), "Alert");*
* ^*
BrainGrapher:63:21: error: expected type-specifier before 'Channel'
* channels[8] = new Channel("High Beta", color(116, 23, 190), "Alert");*
* ^*
BrainGrapher:64:21: error: expected type-specifier before 'Channel'
* channels[9] = new Channel("Low Gamma", color(39, 25, 159), "Multi-sensory processing");*
* ^*
BrainGrapher:65:22: error: expected type-specifier before 'Channel'
* channels[10] = new Channel("High Gamma", color(23, 26, 153), "???");*
* ^*
BrainGrapher:79:23: error: 'monitors' was not declared in this scope
* for (int i = 0; i < monitors.length; i++) {*
* ^*
BrainGrapher:80:23: error: expected type-specifier before 'Monitor'
monitors = new Monitor(channels[i + 1], i * (width / 10), height / 2, width / 10, height / 2);
* ^*
BrainGrapher:83:3: error: 'monitors' was not declared in this scope
* monitors[monitors.length - 1].w += width % monitors.length;*
* ^*
BrainGrapher:83:38: error: 'width' was not declared in this scope
* monitors[monitors.length - 1].w += width % monitors.length;*
* ^*
BrainGrapher:86:3: error: 'graph' was not declared in this scope
* graph = new Graph(0, 0, width, height / 2);*
* ^*
BrainGrapher:86:15: error: expected type-specifier before 'Graph'
* graph = new Graph(0, 0, width, height / 2);*
* ^*
BrainGrapher:89:3: error: 'connectionLight' was not declared in this scope
* connectionLight = new ConnectionLight(width - 140, 10, 20);*
* ^*
BrainGrapher:89:25: error: expected type-specifier before 'ConnectionLight'
* connectionLight = new ConnectionLight(width - 140, 10, 20);*
* ^*
/Users/dorian/Downloads/kitschpatrol-BrainGrapher-31cc148/BrainGrapher/BrainGrapher.pde: In function 'void draw()':
BrainGrapher:94:33: error: 'channels' was not declared in this scope
* if (scaleMode == "Global" && (channels.length > 3)) {*
* ^*
BrainGrapher:101:17: error: 'background' was not declared in this scope
* background(255);*
* ^*
BrainGrapher:104:3: error: 'graph' was not declared in this scope
* graph.update();*
* ^*
BrainGrapher:108:3: error: 'connectionLight' was not declared in this scope
* connectionLight.update();*
* ^*
BrainGrapher:112:23: error: 'monitors' was not declared in this scope
* for (int i = 0; i < monitors.length; i++) {*
* ^*
/Users/dorian/Downloads/kitschpatrol-BrainGrapher-31cc148/BrainGrapher/BrainGrapher.pde: At global scope:
BrainGrapher:118:18: error: variable or field 'serialEvent' declared void
void serialEvent(Serial p) {
* ^*
BrainGrapher:118:25: error: expected ')' before 'p'
void serialEvent(Serial p) {
* ^*
exit status 1
'import' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.