From 57dd3261fadcf4e1e71a60ff3333cfc0b60200fc Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Sun, 4 Feb 2024 12:44:31 +0100 Subject: [PATCH] Applies ili9341 display size, fixed button settings and modified code indention. --- ESP32_Oscilloscope/ESP32_Oscilloscope.ino | 37 ++++++++++++----------- ESP32_Oscilloscope/screen.ino | 2 +- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ESP32_Oscilloscope/ESP32_Oscilloscope.ino b/ESP32_Oscilloscope/ESP32_Oscilloscope.ino index 981fce9..c3840b5 100644 --- a/ESP32_Oscilloscope/ESP32_Oscilloscope.ino +++ b/ESP32_Oscilloscope/ESP32_Oscilloscope.ino @@ -1,35 +1,38 @@ +/* Add https://dl.espressif.com/dl/package_esp32_index.json to your arduino IDE to get ESP32 support +*/ + #include #include #include #include + #include + #include #include "esp_adc_cal.h" #include "filters.h" -//#define DEBUG_SERIAL -//#define DEBUG_BUFF +#define DEBUG_SERIAL +#define DEBUG_BUFF #define DELAY 1000 // Width and height of sprite #define WIDTH 240 -#define HEIGHT 280 +#define HEIGHT 320 -#define ADC_CHANNEL ADC1_CHANNEL_5 // GPIO33 -#define NUM_SAMPLES 1000 // number of samples -#define I2S_NUM (0) -#define BUFF_SIZE 50000 +#define ADC_CHANNEL ADC1_CHANNEL_5 // GPIO33 +#define NUM_SAMPLES 1000 // number of samples +#define I2S_NUM (0) +#define BUFF_SIZE 50000 #define B_MULT BUFF_SIZE/NUM_SAMPLES -#define BUTTON_Ok 32 -#define BUTTON_Plus 15 -#define BUTTON_Minus 35 -#define BUTTON_Back 34 - -TFT_eSPI tft = TFT_eSPI(); // Declare object "tft" - -TFT_eSprite spr = TFT_eSprite(&tft); // Declare Sprite object "spr" with pointer to "tft" object +#define BUTTON_Ok 32 +#define BUTTON_Plus 35 +#define BUTTON_Minus 15 +#define BUTTON_Back 34 +TFT_eSPI tft = TFT_eSPI(); // Declare object "tft" +TFT_eSprite spr = TFT_eSprite(&tft); // Declare Sprite object "spr" with pointer to "tft" object esp_adc_cal_characteristics_t adc_chars; @@ -164,7 +167,7 @@ void core0_task( void * pvParameters ) { update_screen(i2s_buff, RATE); updating_screen = false; vTaskDelay(pdMS_TO_TICKS(10)); - Serial.println("CORE0"); + //Serial.println("CORE0"); } vTaskDelay(pdMS_TO_TICKS(10)); @@ -196,7 +199,7 @@ void core1_task( void * pvParameters ) { stop_change = true; } } - Serial.println("CORE1"); + //Serial.println("CORE1"); vTaskDelay(pdMS_TO_TICKS(300)); } else { diff --git a/ESP32_Oscilloscope/screen.ino b/ESP32_Oscilloscope/screen.ino index e32133c..26dfd8b 100644 --- a/ESP32_Oscilloscope/screen.ino +++ b/ESP32_Oscilloscope/screen.ino @@ -1,7 +1,7 @@ void setup_screen() { // Initialise the TFT registers tft.init(); - tft.setRotation(1); + tft.setRotation(3); // Optionally set colour depth to 8 or 16 bits, default is 16 if not spedified spr.setColorDepth(8);