Bean-IO

Use bean-io + octoblu to run johnny-five with the Light Blue Bean

What are we doing?

743

This tutorial will guide you in setting up your Light Blue Bean (bluetooth Arduino), flashing it with firmata (firmware for dynamic pin control), and then using NodeJS on OSX/Linux to control it from Octoblu.

There is a wonderful NodeJS robotics framework called Johnny-Five that lets you use a common API accross multiple hardware platforms. By flashing bean-firmata to your bean and using Bean-IO for Johnny-Five, you'll be able to use Johnny-Five with your bean.

First, you'll need to set-up and flash a Light Blue Bean.

Set-up Bean Loader and Arduino

Install Bean Loader and the latest Arduino IDE
This guide will show you how! Getting Started with Light Blue Bean

Flash bean-firmata

  1. Open up the Arduino IDE
  2. Paste the bean-firmata sketch into the Arduino editor.
495
  1. Select Tools -> Boards -> Light Blue Bean
631
  1. Open up Bean Loader
  2. In the Arduino IDE press the arrow to Upload the firmware
191

Bean Loader will now show that the firmware is available for flashing to a bean

575
  1. Connect to your Bean, then right click and select "Program Sketch" , this can take a minute.
696

Set-Up NodeJS Script

  1. Clone this repo down meshblu-bean-io-examples

You can do so by typing this in the terminal

git clone https://github.com/octoblu/meshblu-bean-io-example
  1. Copy and paste this to your terminal whilst in the directory and hit enter.
npm install && \
node node_modules/meshblu-util/command-register.js -t bean-io > meshblu.json && \
node node_modules/meshblu-util/command-claim.js 

Upon completion your browser will be launched and you will be prompted to claim a device in your Octoblu account. Give it a name and claim it.

  1. You can now run three different examples, each one has a corresponding flow (see next section)

To run them simply type:

node button-example.js

Octoblu Flows

Button Example

Flow: Octoblu Bean Button Example

Wiring: Hackster tutorial

Accelerometer and Temperature Example

Flow: Bean-io Accel-Temp Example

LED Example

Flow: Bean LED Flow

Pin Mappings

Bean to Arduino UNO

Bean PortArduino PinType
A018Analog/Digital
A119AnalogDigital
06Digital — Unavailable right now from firmata
19Digital — Unavailable right now from firmata
210Digital
311Digital
412Digital
513Digital