GithubHelp home page GithubHelp logo

vuechu / brainmeter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.72 MB

A 12 LED display that would indicate the user's focus/attention values

C++ 100.00%
arduino neurosky-mindwave-reader neurosky neurosky-mindwave-headset mindflex

brainmeter's Introduction

BrainMeter

A 12 LED display that would represent the user's focus/attention values using an Arduino Leonardo and the Arduino IDE.

Author's Note:

I created this for the sole purpose of learning how to program on an Arduino, practicing object oriented programming and a doubly linked list. This project was heavily inspired by Michael Reeves who used the Star Wars Force Trainer to drive his car with his mind. Click here. Thank you to kitschpatrol, rambo, and jospehfrazier for providing the library to parse data from the Neurosky EEG headsets and by providing a guide on how to physically modify the Neurosky EEG chip. Click here for the link to their github. If you see anything that can be improved or have any tips (including this readme file), I would greatly appreciate any sort of feedback.

Summary:

This program's purpose is to display the user's focus/attention values through a 12 LED display using the Mindflex EEG headset using an Arduino Leonardo on the Arduino IDE.

Materials needed:

  • Arduino Uno or any board that can utilize Serial - 1 (Click here to check which type of Serial you would have to use for this program.)
    • If you used a Leonardo like I did in the code BrainMeter.ino, you should be completely set with the Serial reference.
    • If you used an Uno, change the references "Serial1" to "Serial". This is due to the fact that Leonardo supports onboard USB, whereas the Uno does not.
  • Breadboard - 1
  • 150Ω resistors - 12
  • LED - 12
  • Any USB that is compatible with your Arduino that can be connected to a computer.
  • A computer.
  • Star Wars Force Trainer or Mindflex headband that utilizes the Neurosky EEG chip.
  • The Brain library needed to parse the incoming data from the headset. Click here for the link to the github.

Diagram:

here

---DoublyLinkedList Class---

  • Struct Node

    • int pinNumber

      • Pin will store the specified pin for each node.
    • int value

      • Value will hold a threshold value for each node.
    • Node* next

      • Will point to the memory address of the next node in the doubly linked list.
    • Node* prev

      • Will point to the memory address of the previous node in the doubly linked list.
  • Attributes

    • Node* head

      • A pointer that keeps track of the first node in the doubly linked list.
    • Node* tail

      • A pointer that keeps track of the last node in the doubly linked list.
    • Node* currentNode

      • A pointer that keeps track of the current location of a node when traversing through the doubly linked list when given a attention/focus value of type int.
  • CONSTRUCTOR

    • DoublyLinkedList(int pinNumber, int value)

      • Instantiates the DoublyLinkedList class by taking in pinNumber and value.
  • FUNCTIONS

    • void setUpPins()

      • Will iterate through each node in the doubly linked list to retrieve its pin values to set it as an output.
    • void insert(int pinNumber, int value)

      • Creates a node and inserts it to the tail of the doubly linked list. Each node will represent an LED on the breadboard.
      • Params: int pinNumber, int value
    • void brainRun(int attentionValue)

      • This function will iterate until the focus/attention values are correctly displayed on the brain meter.
      • Params: int attentionValue

---End of DoublyLinkedList Class---

GLOBAL VARIABLES WORTH MENTIONING

  • Brain brain(Serial1)

    • brain is an object of type Brain that will utilize a Serial (dependent on which board you're using) object to allow communication with the arduino board and the headset.
  • DoublyLinkedList brainMeter

    • brainMeter is an object of type DoublyLinkedList that will allow access, create, and modify the doubly linked list.

FUNCTIONS

  • void setUpNodeAttributes()

    • Creates a node's attributes with an assigned pin number, value for the attention threshold values, and inserts it to the doubly linked list.

brainmeter's People

Contributors

vuechu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.