mill_time = millis(); PWM_time= millis(); if (mill_time % 1000 >= 0 && mill_time_last != (mill_time / 1000)) { mill_time_last = mill_time / 1000; sign++; if (sign > 10)sign = 0; } if (PWM_time % 100 >= 0 && PWM_time_last != (PWM_time / 100)) { PWM_time_last = PWM_time / 100; pwm_sign++; analogWrite(SMG_PWM,pwm_sign); if(pwm_sign>=240)pwm_sign=0; }
暂无评论