2014-07-06 14:17:10 -05:00
|
|
|
# Neurosky
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
NeuroSky delivers fully integrated, single chip EEG biosensors. NeuroSky enables its partners and developers to bring their
|
|
|
|
brainwave application ideas to market with the shortest amount of time, and lowest end consumer price.
|
2014-11-28 15:34:42 -08:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
This package contains the Gobot adaptor and driver for the [Neurosky Mindwave Mobile EEG](http://store.neurosky.com/products/mindwave-mobile).
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-11-28 15:34:42 -08:00
|
|
|
## How to Install
|
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
Please refer to the main [README.md](https://github.com/hybridgroup/gobot/blob/release/README.md)
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
## How To Connect
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
### OSX
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
In order to allow Gobot running on your Mac to access the Mindwave, go to "Bluetooth > Open Bluetooth Preferences > Sharing Setup"
|
|
|
|
and make sure that "Bluetooth Sharing" is checked.
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
Now you must pair with the Mindwave. Open System Preferences > Bluetooth. Now with the Bluetooth devices windows open, hold
|
|
|
|
the On/Pair button on the Mindwave towards the On/Pair text until you see "Mindwave" pop up as available devices. Pair with
|
|
|
|
that device. Once paired your Mindwave will be accessable through the serial device similarly named as `/dev/tty.MindWaveMobile-DevA`
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
### Ubuntu
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
Connecting to the Mindwave from Ubuntu or any other Linux-based OS can be done entirely from the command line using [Gort](https://gobot.io/x/gort)
|
|
|
|
CLI commands. Here are the steps.
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
Find the address of the Mindwave, by using:
|
2023-06-04 18:36:55 +02:00
|
|
|
|
|
|
|
```sh
|
2014-06-09 19:01:53 -07:00
|
|
|
gort scan bluetooth
|
|
|
|
```
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
Pair to Mindwave using this command (substituting the actual address of your Mindwave):
|
2023-06-04 18:36:55 +02:00
|
|
|
|
|
|
|
```sh
|
2014-06-09 19:01:53 -07:00
|
|
|
gort bluetooth pair <address>
|
|
|
|
```
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
Connect to the Mindwave using this command (substituting the actual address of your Mindwave):
|
2023-06-04 18:36:55 +02:00
|
|
|
|
|
|
|
```sh
|
2014-06-09 19:01:53 -07:00
|
|
|
gort bluetooth connect <address>
|
|
|
|
```
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
### Windows
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
You should be able to pair your Mindwave using your normal system tray applet for Bluetooth, and then connect to the
|
|
|
|
COM port that is bound to the device, such as `COM3`.
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-11-28 15:34:42 -08:00
|
|
|
## How to Use
|
|
|
|
|
|
|
|
This small program lets you connect the Neurosky an load data.
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-09 19:01:53 -07:00
|
|
|
```go
|
2014-10-20 11:00:00 -05:00
|
|
|
package main
|
2014-06-09 19:01:53 -07:00
|
|
|
|
|
|
|
import (
|
2023-06-04 18:36:55 +02:00
|
|
|
"fmt"
|
2014-07-10 17:02:00 -07:00
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
"gobot.io/x/gobot/v2"
|
|
|
|
"gobot.io/x/gobot/v2/platforms/neurosky"
|
2014-06-09 19:01:53 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-06-04 18:36:55 +02:00
|
|
|
adaptor := neurosky.NewAdaptor("/dev/rfcomm0")
|
|
|
|
neuro := neurosky.NewDriver(adaptor)
|
|
|
|
|
|
|
|
work := func() {
|
|
|
|
neuro.On(neuro.Event("extended"), func(data interface{}) {
|
|
|
|
fmt.Println("Extended", data)
|
|
|
|
})
|
|
|
|
neuro.On(neuro.Event("signal"), func(data interface{}) {
|
|
|
|
fmt.Println("Signal", data)
|
|
|
|
})
|
|
|
|
neuro.On(neuro.Event("attention"), func(data interface{}) {
|
|
|
|
fmt.Println("Attention", data)
|
|
|
|
})
|
|
|
|
neuro.On(neuro.Event("meditation"), func(data interface{}) {
|
|
|
|
fmt.Println("Meditation", data)
|
|
|
|
})
|
|
|
|
neuro.On(neuro.Event("blink"), func(data interface{}) {
|
|
|
|
fmt.Println("Blink", data)
|
|
|
|
})
|
|
|
|
neuro.On(neuro.Event("wave"), func(data interface{}) {
|
|
|
|
fmt.Println("Wave", data)
|
|
|
|
})
|
|
|
|
neuro.On(neuro.Event("eeg"), func(data interface{}) {
|
|
|
|
eeg := data.(neurosky.EEGData)
|
|
|
|
fmt.Println("Delta", eeg.Delta)
|
|
|
|
fmt.Println("Theta", eeg.Theta)
|
|
|
|
fmt.Println("LoAlpha", eeg.LoAlpha)
|
|
|
|
fmt.Println("HiAlpha", eeg.HiAlpha)
|
|
|
|
fmt.Println("LoBeta", eeg.LoBeta)
|
|
|
|
fmt.Println("HiBeta", eeg.HiBeta)
|
|
|
|
fmt.Println("LoGamma", eeg.LoGamma)
|
|
|
|
fmt.Println("MidGamma", eeg.MidGamma)
|
|
|
|
fmt.Println("\n")
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
robot := gobot.NewRobot("brainBot",
|
|
|
|
[]gobot.Connection{adaptor},
|
|
|
|
[]gobot.Device{neuro},
|
|
|
|
work,
|
|
|
|
)
|
|
|
|
|
|
|
|
robot.Start()
|
2014-06-09 19:01:53 -07:00
|
|
|
}
|
2016-10-01 17:44:12 +02:00
|
|
|
```
|