Applies ili9341 display size, fixed button settings and modified code indention.

This commit is contained in:
Kai Lauterbach 2024-02-04 12:44:31 +01:00
parent 68b0b367e5
commit 57dd3261fa
2 changed files with 21 additions and 18 deletions

View file

@ -1,35 +1,38 @@
/* Add https://dl.espressif.com/dl/package_esp32_index.json to your arduino IDE to get ESP32 support
*/
#include <Arduino.h>
#include <driver/i2s.h>
#include <driver/adc.h>
#include <soc/syscon_reg.h>
#include <TFT_eSPI.h>
#include <SPI.h>
#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 {

View file

@ -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);