学习:LED灯闪烁
const int led_id =13; int led_state = LOW; long previous_millis = 0; long interval = 1000; void setup() { // put your setup code here, to run once: pinMode(led_id,OUTPUT); } void loop() { // put your main code here, to run repeatedly: unsigned long current_millis = millis(); if((current_millis - previous_millis)>interval){ previous_millis = current_millis; if(led_state == LOW){ led_state = HIGH; }else{ led_state = LOW; } } digitalWrite(led_id,led_state); // }
##########################
QQ 3087438119

浙公网安备 33010602011771号