회로도전자부품
2019.06.26 13:10

아두이노 시간함수 BlinkWithoutDelay 함수

조회 수 6085 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

아두이노 시간함수 BlinkWithoutDelay 함수

 

 

const int relayinputpin = 12;

int relayinputState = low;

 

unsigned long previousMillis = 0;

const long interval = 1000;

 

void setup() {

pingMode(relayinputpin, OUTPUT);

}

 

void loop() {

unsigned long currentMillis = millis();

 

if(currentMillis - previousMillis >= interval) {

previousMillis = currentMillis;

 

if(relayinputState == LOW)

relayinputState = HIGH;

else

relayinputState = LOW;

 

digitalWrite(relayinputpin, relayinputState);

}

}

 

 

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
393 Fatal error: Call to a member function get() on null in C:\AutoSet9\public_html\files\cache\template_compiled\4cfb1455260434e25c468dc186e72b58.compiled.php on line 101