Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // change these to your settings
- #define LCD_HOST VSPI
- #define PIN_NUM_CS 5
- #define PIN_NUM_MOSI 23
- #define PIN_NUM_MISO -1
- #define PIN_NUM_CLK 18
- #define PIN_NUM_DC 2
- #define PIN_NUM_RST 4
- #define PIN_NUM_BKL 15
- #define LCD_WRITE_SPEED_PERCENT 200 // 20Mhz - try 400!
- #define LCD_READ_SPEED_PERCENT 200 // 20Mhz - try 400!
- #define LCD_ROTATION 1
- #define LCD_WIDTH 240 // is this right? should be portrait, not landscape either way.
- #define LCD_HEIGHT 320
- #include <Arduino.h>
- #include <tft_io.hpp>
- #include <st7789.hpp>
- #include <gfx_cpp14.hpp>
- using namespace arduino;
- using namespace gfx;
- using bus_type = tft_spi_ex<LCD_HOST,
- PIN_NUM_CS,
- PIN_NUM_MOSI,
- PIN_NUM_MISO,
- PIN_NUM_CLK,
- SPI_MODE0,
- false
- #ifdef OPTIMIZE_DMA
- ,(LCD_WIDTH*LCD_HEIGHT)/8+8
- #endif
- >;
- using lcd_type = st7789<LCD_WIDTH,
- LCD_HEIGHT,
- PIN_NUM_DC,
- PIN_NUM_RST,
- PIN_NUM_BKL,
- bus_type,
- LCD_ROTATION,
- LCD_WRITE_SPEED_PERCENT,
- LCD_READ_SPEED_PERCENT>;
- lcd_type lcd;
- void setup() {}
- void loop() {}
Add Comment
Please, Sign In to add comment