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

.setMode() doesn't work in Promises interface #108

Open
jjeff opened this issue Sep 13, 2020 · 1 comment
Open

.setMode() doesn't work in Promises interface #108

jjeff opened this issue Sep 13, 2020 · 1 comment

Comments

@jjeff
Copy link

jjeff commented Sep 13, 2020

From the documentation, it looks like the Promises interface should mirror all of the functions of the synchronous. However, the following code errors out:

var gpiop = require('rpi-gpio').promise;
gpio.setMode(gpio.MODE_BCM);

Or am I misunderstanding how the module is supposed to work?

@JamesBarwell
Copy link
Owner

From the readme - "All of the same functions are available", so yes this is a bug - thanks for raising it. You should be able to workaround it like this for now:

var gpio = require('rpi-gpio');
var gpiop = gpio.promise;
gpio.setMode(gpio.MODE_BCM);

See test/integration/main.js for a working exampe.

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