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

Tinkerkit touch example throwing errors #1142

Closed
bizcocho-man opened this issue May 31, 2016 · 1 comment
Closed

Tinkerkit touch example throwing errors #1142

bizcocho-man opened this issue May 31, 2016 · 1 comment

Comments

@bizcocho-man
Copy link

Board: Arduino UNO
Shield: Tinkerkit
Hardware having issue with: touch sensor
Johhny-five version: 0.9.51

When trying to run the example provided for Tinkerkit Touch sensor:

var five = require("johnny-five");

new five.Board().on("ready", function() {
  // Attaching to an O* pin in a deviation from
  // TinkerKit tutorials which instruct to attach
  // the touch to an I* pin.
  //
  // For the "touch" module, simply use a Button
  // instance, like this:
  var touch = new five.Button("O5");

  ["down", "up", "hold"].forEach(function(type) {
    touch.on(type, function() {
      console.log(type);
    });
  });
});

The following error is thrown:

/Users/Juan/Downloads/johnny-five-master/node_modules/firmata/lib/firmata.js:849
  this.pins[pin].mode = mode;
                      ^

TypeError: Cannot set property 'mode' of undefined
    at Board.pinMode (/Users/Juan/Downloads/johnny-five-master/node_modules/firmata/lib/firmata.js:849:23)
    at Button.Controllers.DEFAULT.initialize.value (/Users/Juan/Downloads/johnny-five-master/lib/button.js:31:17)
    at new Button (/Users/Juan/Downloads/johnny-five-master/lib/button.js:257:10)
    at Board.<anonymous> (/Users/Juan/Downloads/johnny-five-master/eg/tinkerkit-touch.js:10:15)
    at emitNone (events.js:72:20)
    at Board.emit (events.js:166:7)
    at doNTCallback0 (node.js:417:9)
    at process._tickDomainCallback (node.js:387:13)
@rwaldron
Copy link
Owner

rwaldron commented Jun 1, 2016

Thanks for the report!

I'll have a look at this today

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