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

Option for BCM numbering #3

Open
rdagger opened this issue Apr 3, 2016 · 3 comments
Open

Option for BCM numbering #3

rdagger opened this issue Apr 3, 2016 · 3 comments

Comments

@rdagger
Copy link

rdagger commented Apr 3, 2016

Great job. This is the first package I’ve found that works flawlessly with the DHT-22. Would it be possible to add an option to use BCM numbering instead of board for the GPIO pins? For example, some packages have a set mode option to switch between BCM and board. Or some packages allow you to specify a string such as “GPIO21” instead of a number for BCM.

@Vuzi
Copy link
Owner

Vuzi commented Apr 4, 2016

Thanks !

I'm using wiringPi for GPIO pins, and I think they allow to use both BCM and board for pin numbering (http://wiringpi.com/pins/). I'll look into it, and maybe add some option to the plugin initialization to set the numbering mode to use.

@FlorianWendelborn
Copy link

As a workaround, you should be able to just warp a "matcher" around this like that:

var matcher = {
  '1': 5,
  '4': 8
};

var DHT22 = new RaspiSensors.Sensor({
    type    : "DHT22",
    pin: matcher[4] 
}

@rdagger
Copy link
Author

rdagger commented Apr 4, 2016

Thanks, the wiring gets confusing when you are working with multiple packages and they have different numbering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants