touch_audio示例程序

进入touch_audio工程目录

cd esp-dev-kits/esp32-s2-kaluga-1/examples/touch_audio

配置工程

idf.py set-target esp32s2 menuconfig

Example Configuration—>touch pad type (ESP32-S2-KALUGA_V1.2)
Example Configuration—>audio pad type (ESP32-S2-KALUGA_V1.2)
这里只有V1.2寻找,所以选择V1.2

编译,同样,这里有用到touch,有同样的编译问题,修改如下

diff --git a/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c b/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c
old mode 100644
new mode 100755
index 0b631bb..da1eeab
--- a/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c
+++ b/esp32-s2-kaluga-1/examples/touch_audio/components/touch/touch.c
@@ -83,7 +83,7 @@ static void touchsensor_interrupt_cb(void *arg)
     evt.pad_num = touch_pad_get_current_meas_channel();
 
     if (evt.intr_mask & TOUCH_PAD_INTR_MASK_DONE) {
-        touch_pad_filter_read_baseline(evt.pad_num, &evt.pad_val);
+        touch_pad_read_benchmark(evt.pad_num, &evt.pad_val);
     }
 
     xQueueSendFromISR(que_touch, &evt, &task_awoken);
@@ -99,7 +99,7 @@ static void tp_example_set_thresholds(void)
 
     for (int i = 0; i < TOUCH_BUTTON_NUM; i++) {
         /*!< read baseline value */
-        touch_pad_filter_read_baseline(button[i], &touch_value);
+        touch_pad_read_benchmark(button[i], &touch_value);
         /*!< set interrupt threshold. */
         touch_pad_set_thresh(button[i], touch_value * button_threshold[i]);
         ESP_LOGI(TAG, "test init: touch pad [%d] base %d, thresh %d", \
@@ -113,10 +113,10 @@ static void touchsensor_filter_set(touch_filter_mode_t mode)
     touch_filter_config_t filter_info = {
         .mode = mode,           /*!< Test jitter and filter 1/4. */
         .debounce_cnt = 1,      /*!< 1 time count. */
-        .hysteresis_thr = 3,    /*!< 3% */
+        //.hysteresis_thr = 3,    /*!< 3% */
         .noise_thr = 0,         /*!< 50% */
-        .noise_neg_thr = 0,     /*!< 50% */
-        .neg_noise_limit = 10,  /*!< 10 time count. */
+        //.noise_neg_thr = 0,     /*!< 50% */
+        //.neg_noise_limit = 10,  /*!< 10 time count. */
         .jitter_step = 4,       /*!< use for jitter mode. */
     };
     touch_pad_filter_set_config(&filter_info);

烧录

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值