Link to wiringpi<->BCM GPIO numbering scheme

This commit is contained in:
Ondrej Mikle 2018-04-29 19:40:22 +02:00
parent 408dcd5ad2
commit 918a64df81
2 changed files with 4 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View file

@ -36,9 +36,11 @@ class UnlockerWiringPi(Unlocker):
def __init__(self, config): def __init__(self, config):
import wiringpi import wiringpi
Unlocker.__init__(self, config) Unlocker.__init__(self, config)
wiringpi.wiringPiSetupGpio() # pin numbers follow P1 GPIO header # PIN numbers follow P1 header BCM GPIO numbering, see https://projects.drogon.net/raspberry-pi/wiringpi/pins/
# Local copy of the P1 in repo mapping see gpio_vs_wiringpi_numbering_scheme.png.
wiringpi.wiringPiSetupGpio()
self.lockPin = self.config.getint("UnlockerWiringPi", "lock_pin") self.lockPin = self.config.getint("UnlockerWiringPi", "lock_pin")
wiringpi.pinMode(self.lockPin, 1) #output wiringpi.pinMode(self.lockPin, wiringpi.OUTPUT) #output
def unlock(self): def unlock(self):
"""Unlocks lock at configured pin by pulling it high. """Unlocks lock at configured pin by pulling it high.