def __init__(self): GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) print GPIO.RPI_REVISION print GPIO.VERSION self.PINS = { 'tBacklight': { 'input': False, 'pin': 11, 'setup': False, 'inverse': False, 'pup': False }, 'pLeft': { 'input': True, 'pin': 10, 'setup': False, 'inverse': True, 'pup': True }, 'pRight': { 'input': True, 'pin': 9, 'setup': False, 'inverse': True, 'pup': True }, 'pOk': { 'input': True, 'pin': 27, 'setup': False, 'inverse': True, 'pup': True }, 'pRotaryB': { 'input': True, 'pin': 22, 'setup': False, 'inverse': True, 'pup': True }, 'pRotaryA': { 'input': True, 'pin': 17, 'setup': False, 'inverse': True, 'pup': True }, }
def __init__(self): self.pinB = 11 self.pinA = 13 GPIO.setmode(GPIO.BOARD) # The following lines enable the internal pull-up resistors # on version 2 (latest) boards GPIO.setwarnings(False) GPIO.setup(self.pinA, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(self.pinB, GPIO.IN, pull_up_down=GPIO.PUD_UP) #GPIO.setup(self.button, GPIO.IN, pull_up_down=GPIO.PUD_UP self.encoder0Pos = 0 self.busy = False self.clockwise = None self.counterclockwise = None # Add event detection to the GPIO inputs GPIO.add_event_detect(self.pinA, GPIO.FALLING, callback=self.switch_eventA)
def __init__(self, callback): self.pinA = 10 # was 13 self.pinB = 9 #was 11 # self.button=27 # was 15 self.callback = callback GPIO.setmode(GPIO.BOARD) self.left = 0 self.right = 0 # The following lines enable the internal pull-up resistors # on version 2 (latest) boards GPIO.setwarnings(False) GPIO.setup(self.pinA, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(self.pinB, GPIO.IN, pull_up_down=GPIO.PUD_UP) #GPIO.setup(self.button, GPIO.IN, pull_up_down=GPIO.PUD_UP # Add event detection to the GPIO inputs GPIO.add_event_detect(self.pinA, GPIO.FALLING, callback=self.switch_event) GPIO.add_event_detect(self.pinB, GPIO.FALLING, callback=self.switch_event) return
def __init__(self): GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) self.PINS = { 'swFerm': { 'input': True, 'pin': 5, 'setup': False, 'inverse': True, 'pup': True }, 'swHlt': { 'input': True, 'pin': 6, 'setup': False, 'inverse': True, 'pup': True }, 'swMash': { 'input': True, 'pin': 12, 'setup': False, 'inverse': True, 'pup': True }, 'swPump': { 'input': True, 'pin': 13, 'setup': False, 'inverse': True, 'pup': True }, 'swSparge': { 'input': True, 'pin': 19, 'setup': False, 'inverse': True, 'pup': True }, 'swBoil': { 'input': True, 'pin': 16, 'setup': False, 'inverse': True, 'pup': True }, 'tBacklight': { 'input': False, 'pin': 18, 'setup': False, 'inverse': False, 'pup': False }, 'pLeft': { 'input': True, 'pin': 10, 'setup': False, 'inverse': True, 'pup': True }, 'pRight': { 'input': True, 'pin': 9, 'setup': False, 'inverse': True, 'pup': True }, 'pOk': { 'input': True, 'pin': 27, 'setup': False, 'inverse': True, 'pup': True }, 'pRotaryA': { 'input': True, 'pin': 22, 'setup': False, 'inverse': True, 'pup': True }, 'pRotaryB': { 'input': True, 'pin': 17, 'setup': False, 'inverse': True, 'pup': True }, }
def __init__(self): self.logging = 3 self.lastLog = ["", "", "", "", "", "", "", "", "", "", ""] GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) if os.path.exists("simulator"): self.simulator = True else: self.simulator = False self.PINS = { 'ssrZoneA': { 'input': False, 'pin': 19, 'setup': False, 'inverse': False, 'pup': True }, # turns on/off power through the SSR 'ssrZoneB': { 'input': False, 'pin': 23, 'setup': False, 'inverse': False, 'pup': True }, # turns on/off power through the SSR 'zoneA': { 'input': False, 'pin': 10, 'setup': False, 'inverse': True, 'pup': True }, # turns on/off power through the SSR 'zoneAuse': { 'input': False, 'pin': 13, 'setup': False, 'inverse': True, 'pup': True }, # NO of the relay for HLT # NC of the relay for Boiler 'extractor': { 'input': False, 'pin': 18, 'setup': False, 'inverse': True, 'pup': True }, 'recircfan': { 'input': False, 'pin': 12, 'setup': False, 'inverse': True, 'pup': True }, 'pump': #DEPRECATED, USED FOR RE-CIRCULATING FAN { 'input': False, 'pin': 12, 'setup': False, 'inverse': True, 'pup': True }, 'zoneB': { 'input': False, 'pin': 26, 'setup': False, 'inverse': True, 'pup': True }, # turns on/off power through the SSR 'zoneBuse': { 'input': False, 'pin': 24, 'setup': False, 'inverse': True, 'pup': True }, # NO of the relay for HLT # NC of the relay for Boiler 'fermHeat': { 'input': False, 'pin': 22, 'setup': False, 'inverse': True, 'pup': True }, 'fermCool': { 'input': False, 'pin': 16, 'setup': False, 'inverse': True, 'pup': True }, 'tempProbes': #DEPRECATED { 'input': False, 'pin': 5, 'setup': False, 'inverse': True, 'pup': True }, }
def configure(): GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False)