Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Led not setting pinmode? #10

Closed
makenai opened this issue Feb 7, 2015 · 1 comment
Closed

Led not setting pinmode? #10

makenai opened this issue Feb 7, 2015 · 1 comment

Comments

@makenai
Copy link

makenai commented Feb 7, 2015

Running with the johnny-five example, I'm getting this error:

Error: Cannot digitalWrite to pin "7" unless it is in OUTPUT mode
    at Raspi.Object.defineProperty.value [as digitalWrite] (/home/pi/spaceJS/node_modules/raspi-io/lib/index.js:307:13)
    at Led.Controllers.DEFAULT.write.value (/home/pi/spaceJS/node_modules/johnny-five/lib/led.js:125:19)
    at Led.on (/home/pi/spaceJS/node_modules/johnny-five/lib/led.js:257:8)
    at Led.toggle (/home/pi/spaceJS/node_modules/johnny-five/lib/led.js:281:40)
    at Led.<anonymous> (/home/pi/spaceJS/node_modules/johnny-five/lib/led.js:462:10)
    at wrapper [as _onTimeout] (timers.js:261:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

Code:

var raspi = require('raspi-io');
var five = require('johnny-five');
var board = new five.Board({
  io: new raspi()
});

board.on('ready', function() {

  // Create an Led on pin 7 (GPIO4) and strobe it on/off
  // Optionally set the speed; defaults to 100ms
  (new five.Led('P1-7')).strobe();

});
@nebrius
Copy link
Owner

nebrius commented Feb 8, 2015

Fixed with 2.0.4 of raspi-io and 0.8.41 of johnny-five, both rolled out just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants