// Eric's notes:
// You can get the signal strength, attention, and meditation values directly by 
// calling the scoutscript:  `print brain.signal`, `print brain.attention`, or 
// `print brain.meditation`.
// This was made by mashing up the Brain library (
// with the Pinoccio bootstrap (
// First, download and install the "brain" library. Then, paste this code into the Arduino IDE,
// save it as a sketch, and upload it to your Scout.

#include <SPI.h>
#include <Wire.h>
#include <Scout.h>
#include <GS.h>
#include <bitlash.h>
#include <lwm.h>
#include <js0n.h>
#include <Brain.h>
#include "version.h"

// hook up the Neurosky to Serial 1 (RX1/TX1)
Brain brain(Serial1);

void setup() {

  // Add custom setup code here

  addBitlashFunction("brain.signal", (bitlash_function)signal);
  addBitlashFunction("brain.attention", (bitlash_function)attention);
  addBitlashFunction("brain.meditation", (bitlash_function)meditation);

void loop() {

  // Add custom loop code here

  char buf[32];

  // Expect packets about once per second.
   if (brain.update()) {

    // signal
    snprintf(buf, sizeof(buf), "on.brain.signal(%d)", brain.readSignalQuality());

    if (findscript(buf)) {

    // attention
    snprintf(buf, sizeof(buf), "on.brain.attention(%d)", brain.readAttention());

    if (findscript(buf)) {

    // meditation
    snprintf(buf, sizeof(buf), "on.brain.meditation(%d)", brain.readMeditation());

    if (findscript(buf)) {

numvar signal() {
  return brain.readSignalQuality();

numvar attention() {
  return brain.readAttention();

numvar meditation() {
  return brain.readMeditation();


Photo on 7 5 17 at 5 06 pm 7 05huowsyxv
Alex Glow

The Hackster team's resident Hardware Nerd. I like robots, music, EEG, wearables, and languages. FIRST Robotics kid.



Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback


Similar projects you might like

DHT22 Sensor and Pinoccio
  • 1,622
  • 5

Full instructions

Using DHT22 Temperature and Humidity sensor with Pinoccio

Human Presence Detection & Visualization
  • 1,070
  • 9

Full instructions

Team Cogitate's social radar displays people nearby as a set of glowing orbs

Hideous Arc Reactor Sweater (WIP)
  • 842
  • 7

Work in progress

Power through the holiday slump with this festive, EEG-reactive sweater!

Pinoccio Craft
  • 378
  • 5

Full instructions

Send Bitlash Pinoccio Commands through Minecraft.

Solar Powered Pinoccio Scout
  • 1,101
  • 9

Run your wireless mesh forever with Adafruit's solar LiPo charger

Pinoccio Programming in Minecraft
  • 1,928
  • 6

Add custom ScoutScript blocks in your virtual domain—then see the real-world effects!

Add projectSign up / Login