From 6806fc9b3f7c9085a0c03b315943774851a4c250 Mon Sep 17 00:00:00 2001 From: sieja Date: Thu, 13 Mar 2025 12:55:11 +0100 Subject: [PATCH] =?UTF-8?q?Korekra=20pin=C3=B3w,=20uproszczenie=20kodu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LCD_RGB_Display_Test.ino | 76 +------------------ 1 file changed, 3 insertions(+), 73 deletions(-) diff --git a/LeonardoProMicro/LCD_RGB_Display_Test/LCD_RGB_Display_Test.ino b/LeonardoProMicro/LCD_RGB_Display_Test/LCD_RGB_Display_Test.ino index d12fe4e..6bc670c 100644 --- a/LeonardoProMicro/LCD_RGB_Display_Test/LCD_RGB_Display_Test.ino +++ b/LeonardoProMicro/LCD_RGB_Display_Test/LCD_RGB_Display_Test.ino @@ -1,83 +1,13 @@ -/************************************************************************** - This is a library for several Adafruit displays based on ST77* drivers. - - Works with the Adafruit 1.8" TFT Breakout w/SD card - ----> http://www.adafruit.com/products/358 - The 1.8" TFT shield - ----> https://www.adafruit.com/product/802 - The 1.44" TFT breakout - ----> https://www.adafruit.com/product/2088 - The 1.14" TFT breakout - ----> https://www.adafruit.com/product/4383 - The 1.3" TFT breakout - ----> https://www.adafruit.com/product/4313 - The 1.54" TFT breakout - ----> https://www.adafruit.com/product/3787 - The 1.69" TFT breakout - ----> https://www.adafruit.com/product/5206 - The 2.0" TFT breakout - ----> https://www.adafruit.com/product/4311 - as well as Adafruit raw 1.8" TFT display - ----> http://www.adafruit.com/products/618 - - Check out the links above for our tutorials and wiring diagrams. - These displays use SPI to communicate, 4 or 5 pins are required to - interface (RST is optional). - - Adafruit invests time and resources providing this open source code, - please support Adafruit and open-source hardware by purchasing - products from Adafruit! - - Written by Limor Fried/Ladyada for Adafruit Industries. - MIT license, all text above must be included in any redistribution - **************************************************************************/ - #include // Core graphics library #include // Hardware-specific library for ST7735 -//#include // Hardware-specific library for ST7789 #include -#if defined(ARDUINO_FEATHER_ESP32) // Feather Huzzah32 - #define TFT_CS 14 - #define TFT_RST 15 - #define TFT_DC 32 +#define TFT_CS 9 +#define TFT_RST 10 // Or set to -1 and connect to Arduino RESET pin +#define TFT_DC 8 -#elif defined(ESP8266) - #define TFT_CS 4 - #define TFT_RST 16 - #define TFT_DC 5 - -#else - // For the breakout board, you can use any 2 or 3 pins. - // These pins will also work for the 1.8" TFT shield. - #define TFT_CS 10 - #define TFT_RST 9 // Or set to -1 and connect to Arduino RESET pin - #define TFT_DC 8 -#endif - -// OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique -// to each board and not reassignable. For Arduino Uno: MOSI = pin 11 and -// SCLK = pin 13. This is the fastest mode of operation and is required if -// using the breakout board's microSD card. - -// For 1.44" and 1.8" TFT with ST7735 use: Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); -// For 1.14", 1.3", 1.54", 1.69", and 2.0" TFT with ST7789: -//Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST); - - -// OPTION 2 lets you interface the display using ANY TWO or THREE PINS, -// tradeoff being that performance is not as fast as hardware SPI above. -//#define TFT_MOSI 11 // Data out -//#define TFT_SCLK 13 // Clock out - -// For ST7735-based displays, we will use this call -//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST); - -// OR for the ST7789-based displays, we will use this call -//Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST); - float p = 3.1415926;