Skip to content

Commit

Permalink
Documentation touch
Browse files Browse the repository at this point in the history
  • Loading branch information
JayBeavers committed Sep 21, 2012
1 parent 3a5063c commit 841485b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
30 changes: 23 additions & 7 deletions README.md
Expand Up @@ -9,16 +9,32 @@ The commands exposed are:
- BrakeVcc: Hard brake using battery power to halt the drive shafts
- ReadCurrent: Read the current consumed by the motors

## Installing to Arduino

To install this library, upload sketch ReflectaMonsterMoto to your Arduino. Note that you must first [install the Reflecta Arduino libraries](https://github.com/JayBeavers/Reflecta#getting-started).

To call this library, use the [Reflecta Node Client](https://github.com/JayBeavers/Reflecta/tree/master/NodeClient) library. A simple example is:
## Calling from NodeJS

To call this library, use the [node-reflecta](https://github.com/JayBeavers/node-reflecta) library which can be installed using npm:

```
npm install reflecta
```

A simple example is:

```javascript
var reflecta = require('reflecta');
reflecta.detect(function(error, boards, ports) {

// Choose the first board found
var board = boards[0];
board.moto1.drive(75, 75);
board.moto1.brakeGround();
});
```

var devicePath = "/dev/ttyACM0"; // or "COM4" in Windows
var Reflecta = require('reflecta.js');
var reflecta = new Reflecta(devicePath, function(err) {
reflecta.moto1.drive(75, 75);
reflecta.moto1.brakeGround();
});
[A simple example](https://github.com/JayBeavers/node-reflecta/blob/master/samples/moto1.js) can be found in the node-reflecta project.

### Future Work ###

Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "reflecta_moto1",
"description": "Node.js client for the Reflecta moto1 interface for motor control boards like the Sparkfun Monster Moto",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/JayBeavers/reflecta_moto1",
"author": {
"name": "Jay Beavers",
Expand All @@ -21,7 +21,7 @@
"url": "https://github.com/JayBeavers/jaybeavers/reflecta_moto1/blob/master/LICENSE"
}
],
"main": "reflecta",
"main": "reflecta_moto1",
"engines": {
"node": ">= 0.8.1"
}
Expand Down

0 comments on commit 841485b

Please sign in to comment.