https://github.com/webduinoio/webduino-bluetooth-transport
🔌 Bluetooth Transport Plugin for webduino-js
https://github.com/webduinoio/webduino-bluetooth-transport
bluetooth webduino webduino-js
Last synced: 9 months ago
JSON representation
🔌 Bluetooth Transport Plugin for webduino-js
- Host: GitHub
- URL: https://github.com/webduinoio/webduino-bluetooth-transport
- Owner: webduinoio
- License: mit
- Created: 2015-11-10T08:37:47.000Z (about 10 years ago)
- Default Branch: gh-pages
- Last Pushed: 2018-05-30T03:17:32.000Z (over 7 years ago)
- Last Synced: 2025-03-03T15:03:07.282Z (10 months ago)
- Topics: bluetooth, webduino, webduino-js
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webduino-bluetooth-transport
Bluetooth Transport Plugin for webduino-js
## Prerequisite
When running in browser, you must have the following installed:
1. [API Proxy for Google Chromeâ„¢](https://chrome.google.com/webstore/detail/api-proxy-for-google-chro/pddlkidaibpbhpkfbhkbeolbagpmkhhn) (launch before opening your application)
2. [API Proxy Agent for Google Chromeâ„¢](https://chrome.google.com/webstore/detail/api-proxy-agent-for-googl/kdhdgaemffmpfmceolgbfpnfiafbjdkp)
to interface with Webduino/Arduino via Bluetooth.
## Installation
### Browser
_See also:_
[webduino-js](https://github.com/webduinoio/webduino-js)
The webduino-base.js or webduino-all.js has bundled serial and bluetooth transports by default. If you have successfully built it or use the CDN version, you are ready to go.
### Cordova
Using [bower](http://bower.io):
```sh
$ bower install webduinoio/webduino-bluetooth-transport
```
In project directory:
```sh
$ cordova plugin add cordova-plugin-bluetooth-serial
```
Insert script _after_ webduino-base.js (or webduino-all.js):
```html
... (modules used)
```
### Node.js
```sh
$ npm install webduino-bluetooth-transport
```
## Usage
**webduino-js** provides isomorphic APIs:
```javascript
// need to acquire 'webduino' in Node.js:
// var webduino = require('webduino-js');
var board, led;
board = new webduino.Arduino({
transport: 'bluetooth',
address: 'xx:xx:xx:xx:xx:xx'
});
// Or:
// board = new webduino.Arduino({
// transport: require('webduino-bluetooth-transport'),
// address: 'xx:xx:xx:xx:xx:xx'
// });
board.on('ready', function() {
led = new webduino.module.Led(board, board.getDigitalPin(10));
led.on();
});
```
## [License](LICENSE)