esp32触摸和LED灯显示
调用模拟analogwrite_esp32库
调用oneButton库
调用Simplertimer库
#include <Arduino.h>
#include <analogWrite.h>
#include <OneButton.h>
#include <SimpleTimer.h>
volatile int alllight;
volatile int halflight;
volatile int offflight;
OneButton button23(23,true); //按键GPIO
SimpleTimer timer;
void gotTouch4() {
Serial.println("led1 detected");
analogWrite(19, alllight);
analogWrite(18, halflight);
analogWrite(5, halflight);
timer.setTimer(12000, super_delay_function2, 1);