 
     pinMode(this->pin_led, INPUT);
 
-    SetPinFrequencySafe(this->pin_pwm, 50);
-    pwmWrite(this->pin_pwm, 127);
+//    SetPinFrequencySafe(this->pin_pwm, 50);
+//    pwmWrite(this->pin_pwm, 127);
 
     pinMode(this->pin_touch, INPUT);
 

      json data from yunba service
*/
#include <ArduinoJson.h>
#include <PWM.h>

#define MSG_TYPE_UP 0x01
#define MSG_TYPE_DOWN 0x02

uint16_t g_body_len = 0;
uint16_t g_recv_len = 0;

ChildSwitch *g_child[CHILD_NUM];

char g_need_report = 1;
unsigned long g_check_ms = 0;


class ChildSwitch {
private:
  int pin_ctrl; /* 控制继电器 */
  int pin_led; /* 控制开关的指示LED */
  int pin_touch; /* 接受来自触摸面板的开关信号  */

  int ctrl_value; /* 当前继电器状态 */

  int touch_value; /* 当前触摸面板认为的开关状态 */
  int low_cnt; /* 触摸面板开关信号为低的计数, 当超过 MAX_LOW_CNT, 认为是关信号(因为面板输出不稳定的脉冲) */

public:
  ChildSwitch(int pin_ctrl, int pin_led, int pin_touch) {
    this->pin_ctrl = pin_ctrl;
    this->pin_led = pin_led;
//    this->pin_pwm = pin_pwm;
    this->pin_touch = pin_touch;

    pinMode(this->pin_ctrl, OUTPUT);
