Esempio n. 1
0
 def __init__(self):
     """
     Initializer, mainly sets GPIO
     """
     tlu_hardwarebase.__init__(self)
     GPIO.setup(self.touch_bcm, GPIO.IN, pull_up_down=GPIO.PUD_UP)
     logging.info("Touch now initialized")
Esempio n. 2
0
 def __init__(self):
     """
     Initializer, mainly sets GPIO
     """
     tlu_hardwarebase.__init__(self)
     GPIO.setup(self.button_up, GPIO.IN, pull_up_down=GPIO.PUD_UP)
     GPIO.setup(self.button_down, GPIO.IN, pull_up_down=GPIO.PUD_UP)
     GPIO.setup(self.button_left, GPIO.IN, pull_up_down=GPIO.PUD_UP)
     GPIO.setup(self.button_right, GPIO.IN, pull_up_down=GPIO.PUD_UP)
     logging.info("Cursor now initialized")
Esempio n. 3
0
 def __init__(self):
     """
     Initializes the hardware
     """
     tlu_hardwarebase.__init__(self)
     if fakeIO:
         self.segment = SevenSegment(address=self.led_7seg_address)
     else:
         self.segment = SevenSegment.SevenSegment(address=self.led_7seg_address)
     self.segment.begin()
     self.segment.clear()
     self.segment.write_display()
Esempio n. 4
0
 def __init__(self):
     """
     Initializer, mainly sets hardware
     """
     tlu_hardwarebase.__init__(self)
     # create matrix device
     # cascaded = Number of cascaded MAX7219 LED matrices, default=1
     # block_orientation = choices 0, 90, -90, Corrects block orientation when wired vertically, default=0
     # rotate = choices 0, 1, 2, 3, Rotate display 0=0°, 1=90°, 2=180°, 3=270°, default=0
     if FakeIO:
         logger.info("Init")
     else:
         self.serial = spi(port=0, device=1, gpio=noop())
         self.device = max7219(self.serial,
                               cascaded=1,
                               block_orientation=90,
                               rotate=0)
Esempio n. 5
0
    def __init__(self):
        """
        Initializes the class
        """
        tlu_hardwarebase.__init__(self)

        # Die IDs der Buttons werden festgelegt
        self.buttonIDs = [[4, 3, 2, 1], [8, 7, 6, 5], [12, 11, 10, 9],
                          [16, 15, 14, 13]]
        # GPIO Pins für die Zeilen werden deklariert.
        self.rowPins = [27, 22, 5, 6]
        # GPIO Pins für die Spalte werden deklariert.
        self.columnPins = [13, 19, 26, 25]

        # Definiere Vier Inputs mit pull up Widerständen.
        for i in range(len(self.rowPins)):
            GPIO.setup(self.rowPins[i], GPIO.IN, pull_up_down=GPIO.PUD_UP)

        # Definiere Vier Outputs und setze sie auf high.
        for j in range(len(self.columnPins)):
            GPIO.setup(self.columnPins[j], GPIO.OUT)
            GPIO.output(self.columnPins[j], 1)
        logging.info("Button-hardware is now initialized")
Esempio n. 6
0
 def __init__(self):
     tlu_hardwarebase.__init__(self)
     GPIO.setup(self.vibration_bcm, GPIO.OUT)
Esempio n. 7
0
 def __init__(self):
     tlu_hardwarebase.__init__(self)
     GPIO.setup(self.buzzer_bcm, GPIO.OUT)
Esempio n. 8
0
 def __init__(self):
     """
     Initializes the module
     """
     tlu_hardwarebase.__init__(self)
     self.lcd = LCD.Adafruit_CharLCDBackpack(address=self.lcd_address)