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

Need better documentation on limitations for pins #71

Closed
Frijol opened this issue Jul 19, 2015 · 6 comments
Closed

Need better documentation on limitations for pins #71

Frijol opened this issue Jul 19, 2015 · 6 comments
Milestone

Comments

@Frijol
Copy link
Member

Frijol commented Jul 19, 2015

E.g. only pins 2,5,6,7 on both ports support interrupts.

Other important information that needs documentation?

rwaldron added a commit to rwaldron/t2-firmware that referenced this issue Jul 20, 2015
rwaldron added a commit to rwaldron/t2-firmware that referenced this issue Jul 20, 2015
@Frijol Frijol added this to the ship-list milestone Jul 23, 2015
johnnyman727 added a commit that referenced this issue Jul 23, 2015
Adds tests for pins with interrupt capabilities. Supports gh-71
@johnnyman727
Copy link
Contributor

This could also be integrated into the firmware. ie if someone types tessel.port.A.digital[0].once('high'...) we should throw an error to notify them that interrupts aren't available on that pin.

@rwaldron
Copy link
Contributor

rwaldron commented Sep 1, 2015

we should throw an error to notify them that interrupts aren't available on that pin.

That's what happens already ;)

tessel.port.A.digital[0] won't trigger that error, because tessel.port.A.digital[0] points to tessel.port.A.pin[5] which is a valid interrupt pin.

The following illustrates:

var tessel = require('tessel');

tessel.port.A.pin[0].once('high', function() {
  console.log('interrupted going high');
});
$ t2 run index.js
INFO Connecting to Tessel...
INFO Connected to bishop over LAN
INFO Writing index.js to RAM on bishop (3.072 kB)...
INFO Deployed.
INFO Running index.js...
/usr/lib/node/tessel-export.js:362
      throw new Error('Interrupts are not supported on pin ' + this.pin);
            ^
Error: Interrupts are not supported on pin 0
    at Tessel.Pin.addListener (/usr/lib/node/tessel-export.js:362:13)
    at once (events.js:265:8)
    at Object.<anonymous> (/tmp/remote-script/index.js:4:22)
    at Module._compile (module.js:426:26)
    at Object.Module._extensions..js (module.js:444:10)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:117:18)
    at node.js:948:3
INFO Stopping script...

@johnnyman727
Copy link
Contributor

Ah my mistake! I mixed up .pin and .digital. Thanks @rwaldron!

@Frijol
Copy link
Member Author

Frijol commented Oct 26, 2015

ha, that's actually the problem, people have to guess and check to find that out.
Maybe we just need a better error message, like "that pin doesn't work but these other ones do"

@Frijol
Copy link
Member Author

Frijol commented Apr 15, 2016

this documentation error has been fixed a while ago: https://tessel.io/docs/hardwareAPI#ports-and-pins

@Frijol Frijol closed this as completed Apr 15, 2016
@Frijol Frijol reopened this Apr 15, 2016
@Frijol
Copy link
Member Author

Frijol commented Apr 15, 2016

reopening because we should give people a path forward in the error message

@Frijol Frijol closed this as completed in 08f0959 Apr 15, 2016
Frijol added a commit that referenced this issue Apr 15, 2016
rwaldron added a commit that referenced this issue Apr 15, 2016
Signed-off-by: Rick Waldron <[email protected]>
tcr pushed a commit that referenced this issue Apr 24, 2016
tcr pushed a commit that referenced this issue Apr 24, 2016
Signed-off-by: Rick Waldron <[email protected]>
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

3 participants