10. 소스코드 작성하기
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(12, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
}
11. 소스코드 작성하기
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(12, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
}
컴파일, 업로드를 눌러보자!
13. 소스코드 작성하기
// the setup function runs once when you press reset or power the board
void setup() {
//
pinMode(12, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(12, HIGH); //
delay(1000); // (1000 = 1 second)
digitalWrite(12, LOW); //
delay(1000); //
}
pinMode( , ); :
digitalWrite( , ); :
delay( ); :
15. 응용해보자!
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(12, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(12, HIGH);
delay(random(1000)); // (1000 = 1 second)
digitalWrite(12, LOW);
delay(random(1000));
}
끝!