Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sandeepmistry/node-bbc-microbit-io
Johnny-Five IO Plugin for the BBC micro:bit
https://github.com/sandeepmistry/node-bbc-microbit-io
Last synced: about 2 months ago
JSON representation
Johnny-Five IO Plugin for the BBC micro:bit
- Host: GitHub
- URL: https://github.com/sandeepmistry/node-bbc-microbit-io
- Owner: sandeepmistry
- License: mit
- Created: 2016-07-10T17:19:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-16T16:44:20.000Z (almost 8 years ago)
- Last Synced: 2024-09-24T13:48:36.385Z (3 months ago)
- Language: JavaScript
- Size: 272 KB
- Stars: 17
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-microbit-zh - node-bbc-microbit-io - Johnny-Five (JavaScript机器人和IoT 编程平台) micro:bit IO 插件. (编程 / JavaScript 和 MakeCode)
README
# bbc-microbit-io
![logo](images/microbit-j5.png)
[Johnny-Five](https://github.com/rwaldron/johnny-five) [IO Plugin](https://github.com/rwaldron/io-plugins) for the [BBC micro:bit](https://www.microbit.co.uk/)
## Prerequisites
* [BBC micro:bit](https://www.microbit.co.uk/)
* Bluetooth Low Energy capable Mac or Linux computer
* See [node-bbc-microbit prerequisites](https://github.com/sandeepmistry/node-bbc-microbit#prerequisites)## Getting Started
```sh
npm install bbc-microbit-io johnny-five
```## Boilerplate Program
```javascript
var five = require('johnny-five');
var microbitio = require('bbc-microbit-io');var board = new five.Board({
' // optional
io: new microbitio({
// id: '', // optional
// address: '
})
});board.on('ready', function() {
// do Johnny-Five stuff
});
```## Examples
See [examples](examples) folder as well as [Johnny-Five examples](http://johnny-five.io/examples/).
## API
See [Johnny-Five API docs](http://johnny-five.io/api/).
## Pin Guide
| Johnny-Five Compatible Name | Number | Supported Modes |
|-----------------------------|--------|-----------------|
| A0 | 0 | Input, Output, Analog, PWM |
| A1 | 1 | Input, Output, Analog, PWM |
| A2 | 2 | Input, Output, Analog, PWM |
| A3 | 3 | Input, Output, Analog, PWM |
| A4 | 4 | Input, Output, Analog, PWM |
| | 5 | Input, Output |
| | 6 | Input, Output |
| | 7 | Input, Output |
| | 8 | Input, Output |
| | 9 | Input, Output |
| A5 | 10 | Input, Output, Analog, PWM |
| | 11 | Input, Output |
| | 12 | Input, Output |
| | 13 | Input, Output |
| | 14 | Input, Output |
| | 15 | Input, Output |
| | 16 | Input, Output |
| | 17 | - |
| | 18 | - |
| | 19 | Input, Output |
| | 20 | Input, Output |![micro:bit pinouts](https://az742082.vo.msecnd.net/pub/xdossmmf)
## Additional Features
| Type | Usage | Johnny-Five type |
| ---- | ----- | -------- |
| Accelerometer | `new microbitio.Accelerometer();` | [five.Accelerometer](http://johnny-five.io/api/accelerometer/) |
| Button | `new microbitio.Button('A');` or `new microbitio.Button('B');` | [five.Button](http://johnny-five.io/api/button/) |
| Compass | `new microbitio.Compass();` | [five.Compass](http://johnny-five.io/api/compass/) |
| LED Matrix | `new microbitio.LedMatrix();` | [five.Led.Matrix](http://johnny-five.io/api/led.matrix/) |
| Thermometer | `new microbitio.Thermometer();` | [five.Thermometer](http://johnny-five.io/api/thermometer/) |