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

Reverse #47

Closed
thisboyiscrazy opened this issue May 1, 2016 · 8 comments
Closed

Reverse #47

thisboyiscrazy opened this issue May 1, 2016 · 8 comments

Comments

@thisboyiscrazy
Copy link

A lot of times the io is connected to relays the reverse the output. E.G. Gpio goes low, relay closes. It would be nice to have a "reverse" parameter in the constuctor.

@fivdi
Copy link
Owner

fivdi commented May 1, 2016

So writing 0 to a GPIO sets it to 1 and writing a 1 sets it to 0? 0 would read as 1 and 1 would read as 0?

@thisboyiscrazy
Copy link
Author

Exactly.

On Sun, May 1, 2016 at 10:51 AM Brian Cooke notifications@github.com
wrote:

So writing 0 to a GPIO sets it to 1 and writing a 1 sets it to 0? 0 would
read as 1 and 1 would read as 0?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#47 (comment)

@fivdi
Copy link
Owner

fivdi commented May 3, 2016

This should also be possible for inputs. 0 would read as 1 and 1 would read as 0. rising edge interrupts would become falling edge interrupts and falling edge interrupts would become rising edge interrupts.

@fivdi
Copy link
Owner

fivdi commented May 3, 2016

This is a good idea. I'll add it.

@thisboyiscrazy
Copy link
Author

Excellent Thanks

On Tue, May 3, 2016 at 6:32 PM Brian Cooke notifications@github.com wrote:

This is a good idea. I'll add it.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#47 (comment)

@fivdi
Copy link
Owner

fivdi commented May 4, 2016

onoff v1.1.0 was just published on npm. The Gpio constructor has an new option called activeLow that can be used to get the desired functionality:

var Gpio = require('onoff').Gpio,
  input = new Gpio(7, 'in', {activeLow: true}),
  output = new Gpio(8, 'out', {activeLow: true});

@fivdi fivdi closed this as completed May 4, 2016
@thisboyiscrazy
Copy link
Author

Thanks.

On Wed, May 4, 2016, 10:28 AM Brian Cooke notifications@github.com wrote:

onoff v1.1.0 was just published on npm. The Gpio constructor has an new
option called activeLow that can be used to get the desired functionality:

var Gpio = require('onoff').Gpio,
input = new Gpio(7, 'in', {activeLow: true}),
output = new Gpio(8, 'out', {activeLow: true});


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#47 (comment)

@fivdi
Copy link
Owner

fivdi commented May 6, 2016

You're welcome :)
Have fun with onoff.

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