Skip to content

Instantly share code, notes, and snippets.

@taesamja
Last active July 3, 2016 04:01
Show Gist options
  • Save taesamja/318eb3d4fc75cf5d289af477008f6db5 to your computer and use it in GitHub Desktop.
Save taesamja/318eb3d4fc75cf5d289af477008f6db5 to your computer and use it in GitHub Desktop.
//millis()함수 사용
long time = millis() ;
int flag = 1000;
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
if (millis() > time + flag) {
digitalWrite(13, HIGH) ;
}
if (millis() > time + 2*flag) {
time = millis() ;
digitalWrite(13, LOW) ;
}
}
//delay()함수 사용
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
@taesamja
Copy link
Author

taesamja commented Jul 3, 2016

modified

@taesamja
Copy link
Author

taesamja commented Jul 3, 2016

d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment