Additions/cleanup to README.md

This commit is contained in:
Andrew Stewart 2013-10-22 14:18:31 -07:00
parent bc9dd05cbc
commit 719790fc80
1 changed files with 25 additions and 12 deletions

View File

@ -3,9 +3,15 @@
A JavaScript framework for robotics and physical computing using node.js and nactor
## Getting Started
Install the module with: `npm install cylon`
## Examples
**Note:** before running examples in the `examples/` dir, make sure to compile
the source with `grunt coffee` first.
### Javascript:
```javascript
var cylon = require("cylon");
@ -16,7 +22,7 @@ var robot = cylon.robot({
work: function() {
// we do our thing here
every(1.second(), function() { led.toggle(); });
every((1).second(), function() { led.toggle(); });
}
});
@ -24,20 +30,25 @@ var robot = cylon.robot({
robot.start();
```
### CoffeeScrip:
```coffee-script
cylon = require("cylon")
cylon = require "cylon"
# Initialize the robot
robot = cylon.robot
connection:
name: 'arduino', adaptor: 'firmata', port: '/dev/ttyACM0'
name: 'arduino'
adaptor: 'firmata'
port: '/dev/ttyACM0'
device:
name: 'led', driver: 'led', pin: 13
name: 'led'
driver: 'led'
pin: 13
work: ->
# we do our thing here
every 1.second, ->
led.toggle
every 1.second, -> led.toggle
robot.start
```
@ -46,7 +57,9 @@ robot.start
_(Coming soon)_
## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code
using [Grunt](http://gruntjs.com/).
## Release History
_(Nothing yet)_