2018年4月19日星期四

Arduino 蓄电池脉冲源码

int  periodTime =millis() ,  PluseStatus = 0 ;

  if ( PluseStatus == 0 && millis() - periodTime >= 1000 )
  {
       periodTime = millis();
        PluseStatus = 1 ;
        digitalWrite ( PluseCharging , PluseStatus ) ;
  }

    if ( PluseStatus == 1 && millis() - periodTime >= 3000 )
    {
        periodTime = millis();
        PluseStatus = 0 ;
        digitalWrite ( PluseCharging , PluseStatus ) ;
    }

//periodTime 间隔

没有评论:

发表评论