{"id":13521408,"url":"https://github.com/monteslu/bean-io","last_synced_at":"2025-07-16T09:39:29.233Z","repository":{"id":20528405,"uuid":"23807531","full_name":"monteslu/bean-io","owner":"monteslu","description":"Punchthrough LightBlue Bean IO for use with Johnny-five","archived":false,"fork":false,"pushed_at":"2015-11-05T19:39:29.000Z","size":184,"stargazers_count":22,"open_issues_count":6,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-13T21:40:36.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monteslu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-08T20:42:22.000Z","updated_at":"2020-09-25T03:57:44.000Z","dependencies_parsed_at":"2022-07-23T05:47:03.094Z","dependency_job_id":null,"html_url":"https://github.com/monteslu/bean-io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/monteslu/bean-io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteslu%2Fbean-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteslu%2Fbean-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteslu%2Fbean-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteslu%2Fbean-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monteslu","download_url":"https://codeload.github.com/monteslu/bean-io/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monteslu%2Fbean-io/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265254314,"owners_count":23735112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:00:34.036Z","updated_at":"2025-07-16T09:39:29.207Z","avatar_url":"https://github.com/monteslu.png","language":"JavaScript","funding_links":[],"categories":["Libraries and Plugins"],"sub_categories":["IO Compatibility Plugins"],"readme":"# Bean-io\n\nBean-io is a Firmata-compatibility IO class for writing node programs that interact with [LightBlue Bean devices](http://punchthrough.com/bean/). Bean-io was built at [IcedDev](http://iceddev.com/)\n\n### Installation\n\n`npm install bean-io`\n\n### Getting Started\n\nIn order to use the bean-io library, you will need to load a special version of Firmata onto your\nBean device. [Bean Firmata](https://github.com/jacobrosenthal/arduino/blob/bean/examples/StandardFirmata/StandardFirmata.ino)\n\n We recommend you review [Punchthrough's Getting Started guide](http://punchthrough.com/bean/getting-started/) before continuing.\n\n### Linux Instructions\n\nMake sure that libbluetooth-dev and bluez libraries are installed before installing bean-io.\n\n### Blink an Led\n\n\nThe \"Hello World\" of microcontroller programming:\n\n```js\nvar beanio = require(\"bean-io\");\nvar board = new beanio.Board({\n  timeout: 30000 //optional - defaults to 30 seconds\n  // uuid: 'myUuid' //optional - will use first bean found\n});\n\nboard.on(\"ready\", function() {\n  console.log(\"CONNECTED\");\n  this.pinMode(13, this.MODES.OUTPUT);\n\n  var byte = 0;\n\n  // This will \"blink\" the on board led\n  setInterval(function() {\n    this.digitalWrite(13, (byte ^= 1));\n  }.bind(this), 500);\n});\n```\n\n### Johnny-Five IO Plugin\n\nBean-IO can be used as an [IO Plugin](https://github.com/rwaldron/johnny-five/wiki/IO-Plugins) for [Johnny-Five](https://github.com/rwaldron/johnny-five):\n\n```js\nvar five = require(\"johnny-five\");\nvar beanio = require(\"bean-io\");\nvar board = new five.Board({\n  io: new beanio.Board()\n});\n\nboard.on(\"ready\", function() {\n  var led = new five.Led({pin: 13});\n  led.blink();\n});\n```\n\n### Use ble-bean and Johnny-Five Api Together\n\n```js\nvar five = require(\"johnny-five\");\nvar beanio = require(\"bean-io\");\nvar boardIO = new beanio.Board({\n//    name: \"ZAPP\" // optional: you can specify a localName otherwise defaults to nearby bean\n});\n\nvar board = new five.Board({\n  io: boardIO\n});\n\nboard.on(\"ready\", function() {\n\n  var button = new five.Button(12); // button on pin 4\n\n  button.on(\"down\", function() {\n    console.log(\"down\");\n    boardIO.connectedBean.setColor(new Buffer([0, 64, 64]), function(err){\n      console.log('set color on', err);\n    });\n  });\n\n  button.on(\"hold\", function() {\n    console.log(\"hold\");\n    boardIO.connectedBean.setColor(new Buffer([0, 0, 0]), function(err){\n      console.log('set color off', err);\n    });\n  });\n\n  button.on(\"up\", function() {\n    console.log(\"up\");\n\n  });\n});\n```\n\n\n### API\n\nBean-IO subclasses firmata.js and provides the same API.\n\n\n### Pin Mappings\n\nBean to Arduino UNO\n\n\n| Bean Port | Arduino Pin | Type |\n|----------|-------------|------|\n|A0|18|Analog/Digital|\n|A1|19|AnalogDigital|\n|0|6|Digital — Unavailable right now from firmata|\n|1|9|Digital — Unavailable right now from firmata|\n|2|10|Digital|\n|3|11|Digital|\n|4|12|Digital|\n|5|13|Digital|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonteslu%2Fbean-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonteslu%2Fbean-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonteslu%2Fbean-io/lists"}