Created
January 12, 2021 15:16
-
-
Save remisarrailh/55beeb646ca9a85f575d58a27657ea0a to your computer and use it in GitHub Desktop.
LILYGO® TTGO T8 ESP32-S2 LCD Test (circuitpython)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import digitalio | |
| import board | |
| import busio | |
| import adafruit_rgb_display.st7789 as st7789 | |
| from adafruit_rgb_display import color565 | |
| import time | |
| miso_pin = board.IO4 | |
| mosi_pin = board.IO35 | |
| clk_pin = board.IO36 | |
| reset_pin = board.IO38 | |
| cs_pin = board.IO34 | |
| dc_pin = board.IO37 | |
| backlight_pin = board.IO33 | |
| backlight = digitalio.DigitalInOut(backlight_pin) | |
| backlight.direction = digitalio.Direction.OUTPUT | |
| backlight.value = True | |
| spi = busio.SPI(clock=clk_pin, MOSI=mosi_pin, MISO=miso_pin) | |
| display = st7789.ST7789(spi, | |
| width=135, | |
| height=240, | |
| y_offset=40, | |
| x_offset=50, | |
| rotation=90, | |
| cs=digitalio.DigitalInOut(cs_pin), | |
| dc=digitalio.DigitalInOut(dc_pin), | |
| rst=digitalio.DigitalInOut(reset_pin)) | |
| while True: | |
| # Clear the display | |
| display.fill(0) | |
| # Draw a red pixel in the center. | |
| print("BLACK") | |
| # Pause 2 seconds. | |
| # Clear the screen blue. | |
| display.fill(color565(255, 0, 255)) | |
| print("Blue") | |
| # Pause 2 seconds. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
anyone know what pins the "KEY" button is connected to?