🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

cylon-chip

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cylon-chip - npm Package Compare versions

Comparing version

to
0.3.0

26

lib/adaptor.js

@@ -69,3 +69,3 @@ "use strict";

*
* @param {Number} pinNum the analog pin to read from
* @param {Number} pin the analog pin to read from
* @param {Function} callback a function to be triggered when a value is read

@@ -75,4 +75,6 @@ * @return {void}

*/
Adaptor.prototype.analogRead = function(pinNum, callback) {
this.connector.analogRead(pinNum, callback);
Adaptor.prototype.analogRead = function(pin, callback) {
this.connector.analogRead(pin, function(value) {
this.respond("analogRead", callback, null, value, pin);
}.bind(this));
};

@@ -88,3 +90,3 @@

*
* @param {Number} pinNum the digital pin to read from
* @param {Number} pin the digital pin to read from
* @param {Function} callback a function to be triggered when a value is read

@@ -94,4 +96,6 @@ * @return {void}

*/
Adaptor.prototype.digitalRead = function(pinNum, callback) {
this.connector.digitalRead(pinNum, callback);
Adaptor.prototype.digitalRead = function(pin, callback) {
this.connector.digitalRead(pin, function(value) {
this.respond("digitalRead", callback, null, value, pin);
}.bind(this));
};

@@ -102,3 +106,3 @@

*
* @param {Number} pinNum the digital pin to write to
* @param {Number} pin the digital pin to write to
* @param {Number} value the value to be written to the pin

@@ -109,7 +113,5 @@ * @param {Function} [callback] - (err, val) triggers when write is complete

*/
Adaptor.prototype.digitalWrite = function(pinNum, value, callback) {
this.connector.digitalWrite(pinNum, value);
if (typeof callback === "function") {
callback();
}
Adaptor.prototype.digitalWrite = function(pin, value, callback) {
this.connector.digitalWrite(pin, value);
this.respond("digitalWrite", callback, null, value, pin);
};

@@ -116,0 +118,0 @@

{
"name": "cylon-chip",
"description": "Cylon.js adaptor for the C.H.I.P. single-board computer",
"version": "0.2.0",
"version": "0.3.0",

@@ -6,0 +6,0 @@ "homepage": "http://cylonjs.com",

## Release History
Version 0.3.0 - Correct digitalRead & analogRead responses
Version 0.2.0 - Use Cylon 1.3.0, fix i2cWrite, cleanup dependencies
Version 0.1.0 - Initial release with support for GPIO & I2C