
refer to the site : https://www.youtube.com/watch?v=YWY_Is0L7fE
아듀이노 led 샘플.
코드
---------------------------------------------------------
int LED = 12;
int BUTTON = 4;
void setup() {
// put your setup code here, to run once:
pinMode(LED, OUTPUT);
pinMode(BUTTON, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(BUTTON) == HIGH)
{
digitalWrite(LED,HIGH);
}
else
{
digitalWrite(LED,LOW);
}
}
---------------------------------------------------------
'IoT > 아두이노' 카테고리의 다른 글
아듀이노, LCD 디스플레이와 온도센서(LM35) 를 이용한 온도계 만들기. (0) | 2017.05.13 |
---|---|
아두이노 웹서버만들기 (1) | 2017.04.29 |
ubuntu에 arduino설치하기 (0) | 2017.02.19 |
아듀이노 radar (0) | 2017.01.14 |
(test)arduino, signal lamp(red/yellow/green) (0) | 2016.12.24 |