Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A ruby gem for connecting to the NeuroSky mindset

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 ext
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 example.rb
README.rdoc

mindset

NOTE: This gem is not yet released, its complete('ish) but I'm finishing documentation and final testing/code tidying. If you pull it locally you will be able to build it and install it as a gem.

DESCRIPTION:

A ruby gem for connecting to the NeuroSky mindset

DESIGN

To-do

FEATURES/PROBLEMS:

  • The current parser uses state_machine, this appears to be quite slow and will be replaced in the next update

SYNOPSIS:

require 'mindset'

find_mindset = false
use_mock_mindset = true

if find_mindset
    # Discover your mindset - It must be in pairing mode
    puts Mindset::Device.scan
else
    address = "00:13:EF:00:4B:46" # E.g.
    channel = 3 # I will give some help on this before the gem is released :-)

    device = if use_mock_mindset
        mock = Mindset::MockDevice.new(1024, true)
        mock.queue_event_attention(22)
       mock
    else
        Mindset::Device.new()
    end

    # Create the stream parser and payload parser (with the default logger)
    parser = Mindset::ByteParser.new(Mindset::PayloadParser.new(Mindset::EventLogger.new))

    # Parse the stream
    device.listen(address, channel) do |device|
        Mindset::StreamParser.parse(device, parser)
    end
end

REQUIREMENTS:

  • This has only been tested on Ubuntu. This version will not work on Windows, due to the need to compile native extensions. This should be addressed in the next version. Although I can do this, if anyone feels like adding the code, please go for it.

INSTALL:

  • When I release this gem: sudo gem install mindset, in the meantime you can pull and install locally by building a package

Contact

LICENSE:

(The MIT License)

Copyright © 2011 Mangled

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.