   }
 
   int check_touch() {
-    int i = 0;
-    i = analogRead(this->pin_touch);
-  
-    if (i < MAX_LOW_ANNALOG) {
+    int v = analogRead(this->pin_touch);
+
+    if (v < MAX_LOW_ANNALOG) {
       ++this->low_cnt;
       if (this->low_cnt >= MAX_LOW_CNT) {
         this->low_cnt = 0;


#define FIRST_PIN_CTRL 3
#define FIRST_PIN_LED 6
#define FIRST_PIN_PWM 9
#define FIRST_PIN_TOUCH A1

/* 检测到 MAX_LOW_CNT 次小于 MAX_LOW_ANNALOG 的电压后, 认为是面板发出了关的信号 */
#define MAX_LOW_CNT 16
#define MAX_LOW_ANNALOG 192

#define CHILD_NUM 1


class Child;

const char *g_devid = "switch_0";



    pinMode(this->pin_led, INPUT);

//    SetPinFrequencySafe(this->pin_pwm, 50);
//    pwmWrite(this->pin_pwm, 127);

    pinMode(this->pin_touch, INPUT);

