Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define LCD_WIDTH 135
- #define LCD_HEIGHT 240
- #define LCD_ROTATION 0
- #define LCD_HOST VSPI
- #define PIN_NUM_MISO -1
- #define PIN_NUM_MOSI 19
- #define PIN_NUM_CLK 18
- #define PIN_NUM_CS 5
- #define PIN_NUM_DC 16
- #define PIN_NUM_RST 23
- #define PIN_NUM_BCKL 4
- #include <Arduino.h>
- #include <tft_io.hpp>
- #include <st7789.hpp>
- #include <gfx_cpp14.hpp>
- #include "lenna.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>;
- using lcd_type =st7789<LCD_WIDTH,LCD_HEIGHT,PIN_NUM_DC,PIN_NUM_RST,PIN_NUM_BCKL,bus_type,LCD_ROTATION,400,200>;
- lcd_type lcd;
- using colors = color<typename lcd_type::pixel_type>;
- void setup() {
- Serial.begin(115200);
- draw::filled_rectangle(lcd,(srect16)lcd.bounds(),colors::white);
- Lenna_stream.seek(0); // not necessary, but if we loaded it twice it would be.
- draw::image(lcd,(srect16)lcd.bounds(),&Lenna_stream);
- }
- void loop() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement