공대생 주석마루/아두이노 UNO
(1) Blink
주석마루
2018. 2. 21. 22:30
프로젝트를 시작하기 앞서
기본적인 코딩을 생략한 채 오직 프로젝트만 업로드한다.
-------------------
-Blink란 LED의 깜빡임을 뜻한다
따라서 구성품은
LED,저항,브렛보드,아두이노 우노,연결선이 있다.
-코드는
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(2, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
delay(3000); // wait for a second
}
해당 코드는 디지털 2번을 아웃풋으로 둔 모델이다.
delay는 2000ms, 3000ms로 설정
-회로도
-동영상