I am getting the following compile errors. What am I doing wrong?
THANKS!
Servo
C:\Users\Japper\Documents\Arduino\mindflexservo\mindflexservo.ino:52:3: error: expected '}' at end of input
}
^
exit status 1
Compilation error: 'Serial' does not name a type
code:
#include <Brain.h>
#include <Servo.h>
//////////////////////////
// mindflexservo
////////////////////////??
Serial.begin(9600);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
void loop() { // Expect packets about once per second.
// The .readCSV() function returns a string (well, char*) listing
//the most recent brain data, in the following format:
// "signal strength, attention, meditation, delta, theta, low // alpha, high alpha, low beta, high beta, low gamma, // high gamma"
if (brain.update()) {
// Serial.println(brain.readErrors());
// Serial.println(brain.readCSV());
//sprintf(a, "%c",brain.readCSV());
a = brain.readCSV();
v = a.indexOf(',');
v = a.indexOf(',', v + 1);
v = a.indexOf(',', v + 1);
v = a.indexOf(',', v + 1);
z = a.indexOf(',', v + 1);
a1 = a.substring(v + 1, z);
num = a1.toInt();
v = a.indexOf(',', z + 1);
a = a.substring(z + 1, v);
num1 = a.toInt();
Serial.print("alpha = ");
Serial.println(num1);
output = map(num, 0, 999999, 0, 180);
myservo.write(output); // tell servo to go to position in variable 'pos'
delay(15);
// analogWrite(12,output);
//brain.readCS).toCharArray(a,200);
}