EEG and Arduino

i thought i would try again with another project, since this is a great forum (best forum i’ve been on) an all really helped me last time

so i am trying to use some mind control here my objective is to Move a servo and also use the 5v or 3v (preferably both for 2 objects) to apply voltage when thought about. using the Star wars force trainer

i am VERY new to making arduino programs so the descriptions next to the line of code in the programs i find, i just cant even figure out what the command is for.

My question is where would i place this program in the “brain” program? and pretty much just replace/remove the Button for the brain program
if no one in this section can help could someone direct me to another section or person?

Servo+button program:

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(160);
  }
  else {
    servo1.write(20);
  }
}

“brain” program:

// Arduino Brain Library
// Basic brain example, blinks an LED on pin 13 faster as your "attention" value increases.
// Adapted from the Blink without Delay example distributed with Arduino environment.
//EEG plugged into Arduino Pins RX and ground


#include <Brain.h>

// Set up the brain parser, pass it the hardware serial object you want to listen on.
Brain brain(Serial);

const int ledPin = 13; // 13 is handy because it's on the board.
long interval = 500; // Changes based on attention value.
long previousMillis = 0;
int ledState = LOW;     

void setup() {
	// Set up the LED pin.
	pinMode(ledPin, OUTPUT);
	
	// Start the hardware serial.
	Serial.begin(9600);
}

void loop() {
	// Expect packets about once per second.
	if (brain.update()) {
		Serial.println(brain.readCSV());
		
		// Attention runs from 0 to 100.
		interval = (100 - brain.readAttention()) * 10;
	}
	
	// Make sure we have a signal.
	if(brain.readSignalQuality() == 0) {
		
		// Blink the LED.
	  if (millis() - previousMillis > interval) {
	    // Save the last time you blinked the LED.
	    previousMillis = millis();   

	    // If the LED is off turn it on and vice-versa:
	    if (ledState == LOW)
	      ledState = HIGH;
	    else
	      ledState = LOW;
      
	    // Set the LED with the ledState of the variable:
	    digitalWrite(ledPin, ledState);
	  }	
	}
	else {
    digitalWrite(ledPin, LOW);
	}
	
}

http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html