From 2fb67e44e8164d236c5dc041285fcb62c18b671f Mon Sep 17 00:00:00 2001 From: Slavey Karadzhov Date: Fri, 22 Dec 2023 11:53:04 +0100 Subject: [PATCH] Simulating the screen on Wokwi. --- samples/ScreenTFT_ST7735/app/application.cpp | 16 +++++------ samples/ScreenTFT_ST7735/diagram.json | 30 ++++++++++++++++++++ samples/ScreenTFT_ST7735/wokwi.toml | 5 ++++ 3 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 samples/ScreenTFT_ST7735/diagram.json create mode 100644 samples/ScreenTFT_ST7735/wokwi.toml diff --git a/samples/ScreenTFT_ST7735/app/application.cpp b/samples/ScreenTFT_ST7735/app/application.cpp index b4a2ed3701..6b2c629206 100644 --- a/samples/ScreenTFT_ST7735/app/application.cpp +++ b/samples/ScreenTFT_ST7735/app/application.cpp @@ -12,14 +12,14 @@ * DC (DC) GPIO0 * CS (CS) GPIO2 */ -#define TFT_SCLK 14 -#define TFT_MOSI 13 -#define TFT_RST 16 -#define TFT_DC 0 -#define TFT_CS 2 - -//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST); -Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); +#define TFT_SCLK 18 +#define TFT_MOSI 23 +#define TFT_RST 32 +#define TFT_DC 33 +#define TFT_CS 5 + +Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST); +//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); Timer DemoScreenTimer; float p = 3.1415926; diff --git a/samples/ScreenTFT_ST7735/diagram.json b/samples/ScreenTFT_ST7735/diagram.json new file mode 100644 index 0000000000..7d9dc9a1e6 --- /dev/null +++ b/samples/ScreenTFT_ST7735/diagram.json @@ -0,0 +1,30 @@ +{ + "version": 1, + "author": "Pedro Malo", + "editor": "wokwi", + "parts": [ + { "type": "wokwi-esp32-devkit-v1", "id": "esp", "top": 224.1, "left": 103.57, "attrs": {} }, + { + "type": "wokwi-ili9341", + "id": "lcd1", + "top": 178.2, + "left": 356.9, + "rotate": 90, + "attrs": {} + } + ], + "connections": [ + [ "esp:TX0", "$serialMonitor:RX", "", [] ], + [ "esp:RX0", "$serialMonitor:TX", "", [] ], + [ "lcd1:SCK", "esp:D18", "green", [ "v-0.01", "h-86.4", "v-39.8" ] ], + [ "lcd1:MOSI", "esp:D23", "green", [ "h-57.6", "v-87.91" ] ], + [ "lcd1:RST", "esp:D32", "green", [ "h-38.4", "v-124.8", "h-172.8", "v104.3" ] ], + [ "lcd1:D/C", "esp:D33", "green", [ "h-19.2", "v-124.8", "h-220.8", "v104.2" ] ], + [ "lcd1:CS", "esp:D5", "green", [ "h-57.6", "v9.6", "h-44.73" ] ], + [ "lcd1:MISO", "esp:D19", "green", [ "h-67.2", "v-48", "h9.61", "v-20.51" ] ], + [ "lcd1:GND", "esp:GND.1", "black", [ "h-48", "v75.5" ] ], + [ "lcd1:LED", "esp:VIN", "red", [ "h-28.8", "v-134.41", "h-201.6", "v161.8" ] ], + [ "lcd1:VCC", "esp:VIN", "red", [ "h-9.6", "v-76.8", "h-220.8", "v171.4" ] ] + ], + "dependencies": {} + } \ No newline at end of file diff --git a/samples/ScreenTFT_ST7735/wokwi.toml b/samples/ScreenTFT_ST7735/wokwi.toml new file mode 100644 index 0000000000..9e98bd735c --- /dev/null +++ b/samples/ScreenTFT_ST7735/wokwi.toml @@ -0,0 +1,5 @@ +[wokwi] +version=1 +firmware='out/Esp32/esp32/debug/firmware/app-merged.bin' +elf='out/Esp32/esp32/debug/build/app.out' +gdbServerPort=3333