Updated digital pin lib and example.

This commit is contained in:
Edgar O Silva 2013-11-05 16:19:15 -06:00
parent 3b078321f1
commit b03019544b
3 changed files with 3 additions and 3 deletions

2
dist/digital-pin.js vendored
View File

@ -107,7 +107,7 @@
DigitalPin.prototype._setMode = function(mode) {
var _this = this;
if (this.mode === 'w') {
if (mode === 'w') {
return FS.writeFile("" + GPIO_PATH + "/gpio" + this.pinNum + "/direction", GPIO_DIRECTION_WRITE, function(err) {
if (err) {
return _this.self.emit('error', "Setting up pin direction failed");

View File

@ -1,6 +1,6 @@
require('../dist/digital-pin')
pin4 = new Cylon.IO.DigitalPin(pin: 4)
pin4 = new Cylon.IO.DigitalPin(pin: 4, mode: 'w')
pin4.on('open', (data) ->
console.log("Pin files have been created")

View File

@ -78,7 +78,7 @@ namespace 'Cylon.IO', ->
# Sets the mode for the GPIO pin by writing the correct values to the pin reference files
_setMode: (mode) ->
if @mode == 'w'
if mode == 'w'
FS.writeFile("#{ GPIO_PATH }/gpio#{ @pinNum }/direction", GPIO_DIRECTION_WRITE, (err) =>
if (err)
@self.emit('error', "Setting up pin direction failed")