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

no method for 'pinRead' #2

Closed
60-hz opened this issue May 9, 2021 · 3 comments
Closed

no method for 'pinRead' #2

60-hz opened this issue May 9, 2021 · 3 comments

Comments

@60-hz
Copy link

60-hz commented May 9, 2021

Under OSX 10.15.4, pd 0.51.4, pdfirmata.osx64 v2.0.0:

When send "pinRead 13" message, the console returns:

pdfirmata: no method for 'pinRead'

@NullMember
Copy link
Owner

NullMember commented May 9, 2021

After beta stage I've renamed pinRead method to pinState because it's purpose is reading state of pin, not value of pin. If you're trying to read value of pin you can use digitalIn method. It's similiar to analogIn but instead of pin number you should pass port number (for Uno, Port 0 is pin 0-7, Port 1 is pin 8-13, Port 2 is A0-5).
If reporting (second argument) is non-zero, you will get port values at every update. To disable reporting send zero as second argument. digitalIn will report all values of port, you should extract pin value from it.
To read pin 13 value
[digitalIn 1 1<
|
[pdfirmata]
|
[route digitalIn]
|
[route 1]
|
[>> 5]
|
[& 1]
|
[value of pin 13: $1<
|
[print]

Clearly help file is caused this confusion. I'ts my mistake, sorry about that. Will update it soon.

@NullMember NullMember pinned this issue May 9, 2021
@60-hz
Copy link
Author

60-hz commented May 10, 2021

Nice, thanks for the clarification!

@NullMember
Copy link
Owner

Help file updated in d86714d. Thanks!

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