Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed deps folder. Added Readme definition. Added package.json deat…

…ils. Added Authors tracking. Upgrade to 0.2.3 functionality of node-serialport
  • Loading branch information...
commit cfa0b364f3045f472df3ee429e7ed51df96c94d1 1 parent 72a5bbc
@voodootikigod authored
View
4 AUTHORS
@@ -0,0 +1,4 @@
+# Authors ordered by first contribution.
+
+Tobias Schneider <schneider@uxebu.com>
+Chris Williams <voodootikigod@gmail.com>
View
34 README
@@ -0,0 +1,34 @@
+Version: 0.2.3 - Released March 20, 2011
+
+*****
+
+This package is designed to allow you to control and program an arduino chipset with JavaScript. It leverages the node-serialport code base, so ensure that you have that installed. In order to see what this package can do, please watch [this presentation from JSConf EU 2010](http://jsconf.eu/2010/speaker/livingroombindmotion_function.html) by [Nikolai Onken](http://twitter.com/nonken) and [Jörn Zaefferer](http://bassistance.de/).
+
+*****
+
+How To Use
+==========
+
+Using node-arduino is pretty easy because it is pretty basic. It is essentially a wrapper with arduino specific message handling around the node-serialport library.
+
+To Install
+----------
+
+<pre>
+ npm install serialport arduino
+</pre>
+
+To Use
+------
+
+Opening an arduino board:
+
+<pre>
+ var arduino = require("arduino");
+ var myBoard = arduino.connect("/dev/tty-usbserial1");
+</pre>
+
+Alpha
+-----
+
+This code is still very much alpha and early stage, but that just makes it more fun to work with. If you find an issue/problem, fork it and issue a pull request. No matter what, enjoy and do cool things with this code.
1  deps/node-serialport
@@ -1 +0,0 @@
-Subproject commit 6e4d76b7f097b237bbd96e92e64b6dd0e588b56f
View
35 lib/arduino.js
@@ -6,7 +6,7 @@
*/
var sys = require('sys')
- , SerialPort = require('../deps/node-serialport/serialport').SerialPort
+ , SerialPort = require('serialport').SerialPort
;
const SERIAL_BAUDRATE = 9600;
@@ -32,7 +32,7 @@ exports.DEFAULT = 0x01;
exports.INTERNAL = 0x03;
Board = function (path) {
- this.sp = new SerialPort(path, SERIAL_BAUDRATE);
+ this.sp = new SerialPort(path, {baudrate: SERIAL_BAUDRATE});
}
Board.prototype = {
@@ -40,25 +40,30 @@ Board.prototype = {
this.sp.write(new Buffer([OPC_PIN_MODE, pin, mode]), 3);
}
-, digitalRead : function (pin) {
- // TODO
- }
+ , digitalRead : function (pin) {
+ // TODO
+ }
-, digitalWrite : function (pin, val) {
- this.sp.write(new Buffer([OPC_DIGITAL_WRITE, pin, val]), 3);
- }
+ , digitalWrite : function (pin, val) {
+ this.sp.write(new Buffer([OPC_DIGITAL_WRITE, pin, val]), 3);
+ }
-, analogReference : function (type) {
- this.sp.write(new Buffer([OPC_ANALOG_REFERENCE, type]), 2);
- }
+ , analogReference : function (type) {
+ this.sp.write(new Buffer([OPC_ANALOG_REFERENCE, type]), 2);
+ }
-, analogRead : function (pin) {
- // TODO
- }
+ , analogRead : function (pin) {
+ // TODO
+ }
-, analogWrite : function (pin, val) {
+ , analogWrite : function (pin, val) {
this.sp.write(new Buffer([OPC_ANALOG_WRITE, pin, val]), 3);
+ },
+
+ close: function () {
+ this.sp.close()
}
+
};
exports.connect = function (path) {
View
22 package.json
@@ -0,0 +1,22 @@
+{ "name" : "arduino",
+ "version" : "0.2.3",
+ "description" : "Control your Arduino with Node",
+ "author": "Tobias Schneider <schneider@uxebu.com>",
+ "main": "./lib/arduino",
+ "contributors": [
+ { "name": "Tobias Schneider", "email": "schneider@uxebu.com" },
+ { "name": "Chris Williams", "email": "voodootikigod@gmail.com" }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/voodootikigod/node-arduino.git"
+ }, "dependencies": {
+ "serialport": ">= 0.2.2"
+ },
+ "keywords": ["arduino", "serialport", "robots"],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/voodootikigod/node-arduino.git"
+ },
+ "engines": { "node": ">= 0.4.1 < 0.5.0" }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.