'아듀이노'에 해당되는 글 2건
- 2016.12.25
- 2016.12.24
<<Code>>
int potpin = 0;
int ledpin = 13;
int val = 0;
void setup() {
// put your setup code here, to run once:
pinMode(ledpin,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
val = analogRead(potpin);
Serial.println(val);
delay(1000);
}
조도 센서는 빛의 세기에따라 제어가 필요한 경우에 조건으로 사용가능. 응용을 어떻게 할까..
<<CODE>>
int REDpin = 6;
int YELLOWpin = 5;
int GREENpin = 4;
void setup() {
// put your setup code here, to run once:
pinMode(REDpin, OUTPUT);
pinMode(YELLOWpin, OUTPUT);
pinMode(GREENpin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(REDpin, HIGH);
delay(3000);
digitalWrite(REDpin, LOW);
digitalWrite(YELLOWpin, HIGH);
delay(3000);
digitalWrite(YELLOWpin, LOW);
digitalWrite(GREENpin, HIGH);
delay(3000);
digitalWrite(GREENpin, LOW);
}
아듀이노, LCD 디스플레이와 온도센서(LM35) 를 이용한 온도계 만들기. (0) | 2017.05.13 |
---|---|
아두이노 웹서버만들기 (1) | 2017.04.29 |
ubuntu에 arduino설치하기 (0) | 2017.02.19 |
아듀이노 radar (0) | 2017.01.14 |
(test)arduino led with button (0) | 2016.12.24 |