raspi-sensors
raspi-sensors copied to clipboard
Option for BCM numbering
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.
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.
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]
}
Thanks, the wiring gets confusing when you are working with multiple packages and they have different numbering.