Bean-io
Bean-io is a Firmata-compatibility IO class for writing node programs that interact with LightBlue Bean devices. Bean-io was built at IcedDev
Installation
npm install bean-io
Getting Started
In order to use the bean-io library, you will need to load a special version of Firmata onto your Bean device. Bean Firmata
We recommend you review Punchthrough's Getting Started guide before continuing.
Linux Instructions
Make sure that libbluetooth-dev and bluez libraries are installed before installing bean-io.
Blink an Led
The "Hello World" of microcontroller programming:
var beanio = ;var board = timeout: 30000 //optional - defaults to 30 seconds // uuid: 'myUuid' //optional - will use first bean found; board;
Johnny-Five IO Plugin
Bean-IO can be used as an IO Plugin for Johnny-Five:
var five = ;var beanio = ;var board = io: ; board;
Use ble-bean and Johnny-Five Api Together
var five = ;var beanio = ;var boardIO = // name: "ZAPP" // optional: you can specify a localName otherwise defaults to nearby bean; var board = io: boardIO; board;
API
Bean-IO subclasses firmata.js and provides the same API.
Pin Mappings
Bean to Arduino UNO
Bean Port | Arduino Pin | Type |
---|---|---|
A0 | 18 | Analog/Digital |
A1 | 19 | AnalogDigital |
0 | 6 | Digital — Unavailable right now from firmata |
1 | 9 | Digital — Unavailable right now from firmata |
2 | 10 | Digital |
3 | 11 | Digital |
4 | 12 | Digital |
5 | 13 | Digital |