From 719790fc807b4c613e48474bbc8406c6d1c95106 Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Tue, 22 Oct 2013 14:18:31 -0700 Subject: [PATCH] Additions/cleanup to README.md --- README.md | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8854ec7..df6d470 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,26 @@ 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"); - + // Initialize the robot var robot = cylon.robot({ connection: { name: 'arduino', adaptor: 'firmata', port: '/dev/ttyACM0' }, device: { name: 'led', driver: 'led', pin: 13 }, - + 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' - device: - name: 'led', driver: 'led', pin: 13 - + name: 'arduino' + adaptor: 'firmata' + port: '/dev/ttyACM0' + + device: + 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)_