Johnny-Five IO Plugin for the BBC micro:bit
npm install bbc-microbit-io!logo
Johnny-Five IO Plugin for the BBC micro:bit
* BBC micro:bit
* Bluetooth Low Energy capable Mac or Linux computer
* See node-bbc-microbit prerequisites
``sh`
npm install bbc-microbit-io johnny-five
`javascript
var five = require('johnny-five');
var microbitio = require('bbc-microbit-io');
var board = new five.Board({
io: new microbitio({
// id: '
// address: '' // optional
})
});
board.on('ready', function() {
// do Johnny-Five stuff
});
`
See examples folder as well as Johnny-Five examples.
See Johnny-Five API docs.
| 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 |
| Type | Usage | Johnny-Five type |
| ---- | ----- | -------- |
| Accelerometer | new microbitio.Accelerometer(); | five.Accelerometer |new microbitio.Button('A');
| Button | or new microbitio.Button('B'); | five.Button |new microbitio.Compass();
| Compass | | five.Compass |new microbitio.LedMatrix();
| LED Matrix | | five.Led.Matrix |new microbitio.Thermometer();` | five.Thermometer |
| Thermometer |