Exemple #1
0
    def add_args(argparse):
        """Add supplemental arguments for ST7735."""
        DisplayPIL.add_args(argparse)

        argparse.add_argument("--rotation",
                              help="Rotation in degrees (Default: 90)",
                              type=int,
                              default=90,
                              choices=[0, 90, 180, 270])
        argparse.add_argument("--spi-port",
                              help="SPI port (Default 0)",
                              type=int,
                              default=0,
                              choices=[0, 1])
        argparse.add_argument("--spi-chip-select-pin",
                              help="SPI chip select (Default 1)",
                              type=int,
                              default=1,
                              choices=[0, 1])
        argparse.add_argument("--spi-data-command-pin",
                              help="SPI data/command pin (Default 9)",
                              type=int,
                              default=9)
        argparse.add_argument("--spi-speed-mhz",
                              help="SPI speed in Mhz (Default 80)",
                              type=int,
                              default=80)
        argparse.add_argument("--backlight-pin",
                              help="ST7735 backlight pin (Default 13)",
                              type=int,
                              default=13)
Exemple #2
0
 def __init__(self, args):
     DisplayPIL.__init__(self, args)
     self._st7735 = ST7735(rotation=args.rotation,
                           port=args.spi_port,
                           cs=args.spi_chip_select_pin,
                           dc=args.spi_data_command_pin,
                           backlight=args.backlight_pin,
                           spi_speed_hz=args.spi_speed_mhz * 1000 * 1000)
     self._st7735.begin()
Exemple #3
0
    def redraw(self):
        if not DisplayPIL.redraw(self):
            return

        self._root.title("{title} - {artist}, {album}".format(
            title=self._title, artist=self._artist, album=self._album))

        imagetk = ImageTk.PhotoImage(self._output_image)
        label_image = tkinter.Label(self._root, image=imagetk)
        label_image.place(x=0, y=0, width=self._size, height=self._size)

        self._root.update()
Exemple #4
0
    def __init__(self, args):
        DisplayPIL.__init__(self, args)

        self._root = tkinter.Tk()
        self._root.geometry("{size}x{size}".format(size=self._size))
        self._root.resizable(False, False)
Exemple #5
0
 def redraw(self):
     if DisplayPIL.redraw(self):
         self._st7735.display(self._output_image)