Applies ili9341 display size, fixed button settings and modified code indention.
This commit is contained in:
parent
68b0b367e5
commit
57dd3261fa
2 changed files with 21 additions and 18 deletions
|
@ -1,36 +1,39 @@
|
||||||
|
/* Add https://dl.espressif.com/dl/package_esp32_index.json to your arduino IDE to get ESP32 support
|
||||||
|
*/
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <driver/i2s.h>
|
#include <driver/i2s.h>
|
||||||
#include <driver/adc.h>
|
#include <driver/adc.h>
|
||||||
#include <soc/syscon_reg.h>
|
#include <soc/syscon_reg.h>
|
||||||
|
|
||||||
#include <TFT_eSPI.h>
|
#include <TFT_eSPI.h>
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include "esp_adc_cal.h"
|
#include "esp_adc_cal.h"
|
||||||
#include "filters.h"
|
#include "filters.h"
|
||||||
|
|
||||||
//#define DEBUG_SERIAL
|
#define DEBUG_SERIAL
|
||||||
//#define DEBUG_BUFF
|
#define DEBUG_BUFF
|
||||||
#define DELAY 1000
|
#define DELAY 1000
|
||||||
|
|
||||||
// Width and height of sprite
|
// Width and height of sprite
|
||||||
#define WIDTH 240
|
#define WIDTH 240
|
||||||
#define HEIGHT 280
|
#define HEIGHT 320
|
||||||
|
|
||||||
#define ADC_CHANNEL ADC1_CHANNEL_5 // GPIO33
|
#define ADC_CHANNEL ADC1_CHANNEL_5 // GPIO33
|
||||||
#define NUM_SAMPLES 1000 // number of samples
|
#define NUM_SAMPLES 1000 // number of samples
|
||||||
#define I2S_NUM (0)
|
#define I2S_NUM (0)
|
||||||
#define BUFF_SIZE 50000
|
#define BUFF_SIZE 50000
|
||||||
#define B_MULT BUFF_SIZE/NUM_SAMPLES
|
#define B_MULT BUFF_SIZE/NUM_SAMPLES
|
||||||
|
|
||||||
#define BUTTON_Ok 32
|
#define BUTTON_Ok 32
|
||||||
#define BUTTON_Plus 15
|
#define BUTTON_Plus 35
|
||||||
#define BUTTON_Minus 35
|
#define BUTTON_Minus 15
|
||||||
#define BUTTON_Back 34
|
#define BUTTON_Back 34
|
||||||
|
|
||||||
TFT_eSPI tft = TFT_eSPI(); // Declare object "tft"
|
TFT_eSPI tft = TFT_eSPI(); // Declare object "tft"
|
||||||
|
|
||||||
TFT_eSprite spr = TFT_eSprite(&tft); // Declare Sprite object "spr" with pointer to "tft" object
|
TFT_eSprite spr = TFT_eSprite(&tft); // Declare Sprite object "spr" with pointer to "tft" object
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
esp_adc_cal_characteristics_t adc_chars;
|
esp_adc_cal_characteristics_t adc_chars;
|
||||||
|
|
||||||
TaskHandle_t task_menu;
|
TaskHandle_t task_menu;
|
||||||
|
@ -164,7 +167,7 @@ void core0_task( void * pvParameters ) {
|
||||||
update_screen(i2s_buff, RATE);
|
update_screen(i2s_buff, RATE);
|
||||||
updating_screen = false;
|
updating_screen = false;
|
||||||
vTaskDelay(pdMS_TO_TICKS(10));
|
vTaskDelay(pdMS_TO_TICKS(10));
|
||||||
Serial.println("CORE0");
|
//Serial.println("CORE0");
|
||||||
}
|
}
|
||||||
|
|
||||||
vTaskDelay(pdMS_TO_TICKS(10));
|
vTaskDelay(pdMS_TO_TICKS(10));
|
||||||
|
@ -196,7 +199,7 @@ void core1_task( void * pvParameters ) {
|
||||||
stop_change = true;
|
stop_change = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Serial.println("CORE1");
|
//Serial.println("CORE1");
|
||||||
vTaskDelay(pdMS_TO_TICKS(300));
|
vTaskDelay(pdMS_TO_TICKS(300));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
void setup_screen() {
|
void setup_screen() {
|
||||||
// Initialise the TFT registers
|
// Initialise the TFT registers
|
||||||
tft.init();
|
tft.init();
|
||||||
tft.setRotation(1);
|
tft.setRotation(3);
|
||||||
|
|
||||||
// Optionally set colour depth to 8 or 16 bits, default is 16 if not spedified
|
// Optionally set colour depth to 8 or 16 bits, default is 16 if not spedified
|
||||||
spr.setColorDepth(8);
|
spr.setColorDepth(8);
|
||||||
|
|
Loading…
Reference in a new issue