Arduino (10) 썸네일형 리스트형 LED_blink_fading_delay int ledPin = 11; void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000); for (int fadeValue = 0 ; fadeValue = 0; fadeValue -= 5) { analogWrite(ledPin, fadeValue); delay(30); } } LED_Blink_Fading_millis void setup() { blink_setup(); fading_setup(); Serial.begin(115220); } void loop() { blink_loop(); fading_loop(); } int blink_ledState = LOW; long blink_previousMillis = 0; long blink_interval = 1000; void blink_setup() { pinMode(13, OUTPUT); } void blink_loop() { unsigned long currentMillis = millis(); if(currentMillis - blink_previousMillis >= blink_interval) { blink_previousMillis = currentMil.. 이전 1 2 다음