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 间隔
没有评论:
发表评论