From bd2219c45cd9ec928444bb7be2b06fa22e1df963 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Mon, 14 Oct 2019 16:25:12 -0700 Subject: [PATCH 1/2] Added 240x135 Display support to Pillow Examples --- examples/rgb_display_pillow_demo.py | 1 + examples/rgb_display_pillow_image.py | 3 ++- examples/rgb_display_pillow_stats.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/rgb_display_pillow_demo.py b/examples/rgb_display_pillow_demo.py index ddf0cb5..b3d3cc0 100644 --- a/examples/rgb_display_pillow_demo.py +++ b/examples/rgb_display_pillow_demo.py @@ -26,6 +26,7 @@ # Create the display: #disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789 #disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789 +#disp = st7789.ST7789(spi, rotation=90, width=135, height=240, x_offset=53, y_offset=40, # 1.14" ST7789 #disp = hx8357.HX8357(spi, rotation=180, # 3.5" HX8357 #disp = st7735.ST7735R(spi, rotation=90, # 1.8" ST7735R #disp = st7735.ST7735R(spi, rotation=270, height=128, x_offset=2, y_offset=3, # 1.44" ST7735R diff --git a/examples/rgb_display_pillow_image.py b/examples/rgb_display_pillow_image.py index c2c00cc..b72a19a 100644 --- a/examples/rgb_display_pillow_image.py +++ b/examples/rgb_display_pillow_image.py @@ -1,4 +1,4 @@ -import digitalio +\import digitalio import board from PIL import Image, ImageDraw import adafruit_rgb_display.ili9341 as ili9341 @@ -22,6 +22,7 @@ # Create the display: #disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789 #disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789 +#disp = st7789.ST7789(spi, rotation=90, width=135, height=240, x_offset=53, y_offset=40, # 1.14" ST7789 #disp = hx8357.HX8357(spi, rotation=180, # 3.5" HX8357 #disp = st7735.ST7735R(spi, rotation=90, # 1.8" ST7735R #disp = st7735.ST7735R(spi, rotation=270, height=128, x_offset=2, y_offset=3, # 1.44" ST7735R diff --git a/examples/rgb_display_pillow_stats.py b/examples/rgb_display_pillow_stats.py index 0ab2f6e..e2f4f02 100644 --- a/examples/rgb_display_pillow_stats.py +++ b/examples/rgb_display_pillow_stats.py @@ -24,6 +24,7 @@ # Create the display: #disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789 #disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789 +#disp = st7789.ST7789(spi, rotation=90, width=135, height=240, x_offset=53, y_offset=40, # 1.14" ST7789 #disp = hx8357.HX8357(spi, rotation=180, # 3.5" HX8357 #disp = st7735.ST7735R(spi, rotation=90, # 1.8" ST7735R #disp = st7735.ST7735R(spi, rotation=270, height=128, x_offset=2, y_offset=3, # 1.44" ST7735R From d69e81e108bfefea69a9b5d13f0dcc074560258f Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Mon, 14 Oct 2019 16:39:07 -0700 Subject: [PATCH 2/2] linting --- examples/rgb_display_pillow_demo.py | 2 ++ examples/rgb_display_pillow_image.py | 4 +++- examples/rgb_display_pillow_stats.py | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/rgb_display_pillow_demo.py b/examples/rgb_display_pillow_demo.py index b3d3cc0..ef12e15 100644 --- a/examples/rgb_display_pillow_demo.py +++ b/examples/rgb_display_pillow_demo.py @@ -23,6 +23,7 @@ # Setup SPI bus using hardware SPI: spi = board.SPI() +# pylint: disable=line-too-long # Create the display: #disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789 #disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789 @@ -36,6 +37,7 @@ #disp = ssd1331.SSD1331(spi, rotation=180, # 0.96" SSD1331 disp = ili9341.ILI9341(spi, rotation=90, # 2.2", 2.4", 2.8", 3.2" ILI9341 cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) +# pylint: enable=line-too-long # Create blank image for drawing. # Make sure to create image with mode 'RGB' for full color. diff --git a/examples/rgb_display_pillow_image.py b/examples/rgb_display_pillow_image.py index b72a19a..d9860b2 100644 --- a/examples/rgb_display_pillow_image.py +++ b/examples/rgb_display_pillow_image.py @@ -1,4 +1,4 @@ -\import digitalio +import digitalio import board from PIL import Image, ImageDraw import adafruit_rgb_display.ili9341 as ili9341 @@ -19,6 +19,7 @@ # Setup SPI bus using hardware SPI: spi = board.SPI() +# pylint: disable=line-too-long # Create the display: #disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789 #disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789 @@ -32,6 +33,7 @@ #disp = ssd1331.SSD1331(spi, rotation=180, # 0.96" SSD1331 disp = ili9341.ILI9341(spi, rotation=90, # 2.2", 2.4", 2.8", 3.2" ILI9341 cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) +# pylint: enable=line-too-long # Create blank image for drawing. # Make sure to create image with mode 'RGB' for full color. diff --git a/examples/rgb_display_pillow_stats.py b/examples/rgb_display_pillow_stats.py index e2f4f02..069a832 100644 --- a/examples/rgb_display_pillow_stats.py +++ b/examples/rgb_display_pillow_stats.py @@ -21,6 +21,7 @@ # Setup SPI bus using hardware SPI: spi = board.SPI() +# pylint: disable=line-too-long # Create the display: #disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789 #disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789 @@ -34,6 +35,7 @@ #disp = ssd1331.SSD1331(spi, rotation=180, # 0.96" SSD1331 disp = ili9341.ILI9341(spi, rotation=90, # 2.2", 2.4", 2.8", 3.2" ILI9341 cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) +# pylint: enable=line-too-long # Create blank image for drawing. # Make sure to create image with mode 'RGB' for full color.