Add fluent syntax example to README

This commit is contained in:
Andrew Stewart 2014-10-15 14:07:39 -07:00
parent 157fcec25e
commit 4e8e65ddea
1 changed files with 23 additions and 0 deletions

View File

@ -136,6 +136,29 @@ bots.forEach(function(bot) {
Cylon.start();
```
## Fluent Syntax
For those more familiar with jQuery, D3, or other fluent-style JavaScript
libraries, Cylon.JS also supports a fluent syntax:
```javascript
var cylon = require('cylon');
cylon.robot({
connection: { name: 'arduino', adaptor: 'firmata', port: '/dev/ttyACM0' },
device: { name: 'led', driver: 'led', pin: 13 }
})
.on('ready', function(bot) {
setInterval(function() {
bot.led.toggle();
}, 1000);
})
.start();
```
## Hardware Support
Cylon.js has an extensible syntax for connecting to multiple, different hardware