mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-06-07 16:14:01 +02:00
Link to wiringpi<->BCM GPIO numbering scheme
This commit is contained in:
parent
408dcd5ad2
commit
918a64df81
2 changed files with 4 additions and 2 deletions
BIN
gpio_vs_wiringpi_numbering_scheme.png
Normal file
BIN
gpio_vs_wiringpi_numbering_scheme.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
|
@ -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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue