webduino-bit-module-button
v0.1.2
Published
Button Module for Webduino:bit
Downloads
20
Readme
webduino-bit-module-button
Module for Webduino:bit Button.
Installation
bower
bower install https://github.com/webduinoio/webduino-bit-module-button.git
Node.js
$ npm install webduino-bit-module-button
Usage
let webduino = require('webduino-js');
require('webduino-bit-module-button')(webduino);
const opts = {
board: 'Bit',
device: 'device_id',
transport: 'mqtt'
};
let board = new webduino.board[opts.board](opts);
board.once(webduino.BoardEvent.READY, (board) => {
board.samplingInterval = 250;
const btnA = new webduino.module.Button(board, board.getDigitalPin(35), webduino.module.Button.PULL_UP);
btnA.on("pressed", () => console.log('pressed'));
});
License
This project is licensed under the MIT license, see LICENSE for more information.