조도센서---> led_Green
arduino_2015. 9. 8. 22:36
void setup() {
// put your setup code here, to run once:
pinMode(13, HIGH);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int value = analogRead(A0);
Serial.println(value);
delay(100);
if(value >=100)
{
digitalWrite(13, HIGH);
delay(1000);
}
else
{
digitalWrite(13, LOW);
delay(1000);
}
}
'arduino_' 카테고리의 다른 글
랜덤으로 30개의 숫자를 만들고 짝수일때 빨간 홀수일때 블루 (0) | 2016.02.13 |
---|---|
(smart toilet) 논문 (0) | 2016.01.13 |
Random_led_four (0) | 2015.08.24 |
기초1(switch(1)-> led(on), switch(2)-> led(off) (0) | 2015.08.24 |
기초(switch(ON)-> LED(ON), switch(OFF)-> LED(OFF)) (0) | 2015.08.24 |