Comparing version 0.1.1 to 0.1.2
@@ -151,4 +151,8 @@ var serial = require('serialport'), | ||
self.watch = function (pin) { | ||
self.send(self.WATCH, [ pin ]); | ||
self.watch = function (pin, variance) { | ||
if (variance) { | ||
self.send(self.WATCH, [ pin, variance ]); | ||
} else { | ||
self.send(self.WATCH, [ pin ]); | ||
} | ||
}; | ||
@@ -165,2 +169,8 @@ | ||
EventDuino.A1 = 'A0'; | ||
EventDuino.A1 = 'A1'; | ||
EventDuino.A2 = 'A2'; | ||
EventDuino.A3 = 'A3'; | ||
EventDuino.A4 = 'A4'; | ||
EventDuino.A5 = 'A5'; | ||
@@ -167,0 +177,0 @@ util.inherits(EventDuino, events.EventEmitter); |
@@ -5,7 +5,8 @@ { | ||
"description": "Evented Arduino for Node.js", | ||
"version": "0.1.1", | ||
"homepage": "http://legitimatesounding.com/blog/index.html", | ||
"keywords": [ "arduino", "evented", "sketch" ], | ||
"version": "0.1.2", | ||
"repository": { | ||
"url": "git://github.com/JerrySievert/EventDuino.git" | ||
"url": "http://github.com/JerrySievert/EventDuino.git" | ||
}, | ||
"license": "MIT/X11", | ||
"main": "lib/index.js", | ||
@@ -12,0 +13,0 @@ "scripts": { |
@@ -5,2 +5,4 @@ # EventDuino | ||
[![Build Status](https://secure.travis-ci.org/JerrySievert/EventDuino.png)](http://travis-ci.org/JerrySievert/EventDuino) | ||
Support is pretty basic so far: | ||
@@ -14,2 +16,6 @@ | ||
## Installing | ||
$ npm install eventduino | ||
## On the Arduino | ||
@@ -68,3 +74,3 @@ | ||
Getting and setting of `pins` is very simple. The pin mode is changed automatically. | ||
Getting and setting of `pins` is very simple. The pin mode is changed automatically. It is possible to `get` and `set` both digital and analog pins. | ||
@@ -82,4 +88,4 @@ var eventduino = require('eventduino'); | ||
// get the value of pin 1 | ||
ardy.get(1); | ||
// get the value of analog pin 1 | ||
ardy.get(eventduino.A1); | ||
@@ -92,3 +98,3 @@ // set the LED pin to HIGH (1) | ||
Eventduino can be set into watch mode, which will check for any changes to the `pin` and send a command if one occurs. A `watch` can be setup on as many `pins` as required. | ||
Eventduino can be set into watch mode, which will check for any changes to the `pin` and send a command if one occurs. A `watch` can be setup on as many `pins` as required. As analog pins can have a very active variance, a second parameter `variance` can be passed for analog pins: an `event` will only be emitted if the value read on `watch` changes past the `variance`. | ||
@@ -104,3 +110,3 @@ var eventduino = require('eventduino'); | ||
if (args[0] === 5) { | ||
ardy.unwatch(5); | ||
ardy.unwatch(eventduino.A5); | ||
ardy.set(13, 1); | ||
@@ -114,7 +120,4 @@ } | ||
ardy.watch(1); | ||
ardy.watch(5); | ||
// only emit the event if +- 5 on the read | ||
ardy.watch(eventduino.A5, 5); | ||
}); | ||
## TODO | ||
Implement analog pins. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
26837
18
461
117
1
2