Alright time to glue this stuff together (not literally!)

1. Here's the link to my github so that you can download everything. And a special Thank you to these individuals for bits of python code to that made setting up this project much easier:

- Edwin Dalmaijer for writing the python library to access the Eyetribe eyetracker that is bundled

- Al Sweigart for writing the python library to control the mouse commands

- Chris Liechti for writing the python library to access the serial port

2. Connect everything. So plug in the Eyetracker into the USB port, plug in the Arduino into another USB port, and according to the EMG manual connect the EMG board to the batteries/electrodes/Arduino(in my code it's connected to Digital Pin 7).

3. Start the Eyetracker UI and server, which all happens automatically when you open the Eyetracker software. Then calibrate the eyetracker to your eyes. Overall, performance is best when you're eyes are centered and close to the Eyetracker, and you're indoors. Indoors is better because bright light from one angle (the sun) makes it more difficult for the tracker to see your face/eyes.

4. Open up the Arduino file called "runArduino_EMGserver_digital.ino" and upload it to the Arduino board. Take note of the communications port in the bottom right hand corner of the Arduino window. It should say "Arduino Uno on blahblahblah." That blahblahblah part is the port the Arduino is connected to. You will edit the included python code so that it knows which port to find the Arduino.

5. In the folder 'PyTribe-master' in the runHandsfree.py file on line 13, this is where you'll edit the port. Currently it's '/COM3', but you need to change it to whatever you're using based on what was in the corner of your Arduino window as stated in Step 4 on this page. Line 12 is an example of what it'd look like if you were using a Mac.

(Optional) 6. The x_factor and y_factor variables in runHandsfree2.py is for scaling the values you get from the eyetracker. I found that for my retina macbook pro, when I was in Windows, the eyetracker software didn't return the right X,Y coordinates due to the retina scaling (thought it was 1920 by 1200 rather than 2880 by 1800), so I had to compensate. I left the code in here in case other people run into the same problem, you'll need to tweak the x_factor and y_factor to work with your particular screen. Otherwise, using the hastag # symbol, you can comment out the lines that say: X = X * x_factor and Y = Y * y_factor

7. Save those edits on the runHandsfree.py file.

8. Open up another Command-line prompt or Terminal. Type:

python

Then hit the spacebar so there's a space after the word python. Then click and drag the edited runHandsfree2.py onto the Command-line prompt or Terminal window. This should automatically write the File path so it looks like:

python directory/Path/To/File.py

9. Hit enter! And let it fire up!