»Ë»Ñ Æ÷·³
°³¹ßÀÚÆ÷·³ ÀÔ´Ï´Ù.
  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

¾ÆµÎÀ̳ë ÄÚµù °í¼ö´Ôµé °è½Ã³ª¿ä ¤Ì¤Ì ÇÑ°èºÀÂø4

¾È³çÇϼ¼¿ä.

ÃÊÀ½Æļ¾¼­¸¦ ÀÌ¿ëÇØ ·¥ÇÁ¸¦ ¸¸µé¾ú½À´Ï´Ù.

ÃÊÀ½ÆÄ´Â ¹öÆ°¿ªÇÒ ÀÔ´Ï´Ù.

¼¾¼­ 5CM À̳»¿¡ ¹«¾ð°¡¸¦ °®´Ù´ë¸é ÄÑÁý´Ï´Ù.

Âß ÄÑÁ® ÀÖ´Â »óÅÂÀε¥, ´Ù½Ã 5CM À̳»·Î ¹«¾ð°¡¸¦ °®´Ù´ë¸é ²¨Áý´Ï´Ù.

ÀÏÁ¾ÀÇ ¹öÆ°¿ªÇÒÀ» ÇÏ´Â ¼ÀÀÔ´Ï´Ù. ÃÊÀ½Æļ¾¼­°¡.



Á¦°¡ ¿øÇÏ´Â °ÍÀº 

¿¹¸¦ µé¾î 3°³ÀÇ led A,B,C°¡ ÀÖ´Ù¸é

¸¸¾à ¸Ç óÀ½ 5CM ³»·Î ÃÊÀ½ÆÄ¿¡ Á¢±ÙÇϸé

A´Â ÄÑÁöÁö¸¸ B¿Í C´Â ÄÑÁöÁö ¾Ê´Ù°¡

ÇÑ 10ºÐÀÌ Áö³ª¸é A°¡ ÄÑÁ®ÀÖ´Â »óÅ¿¡¼­ B°¡ ÄÑÁö°í..

30ºÐÀÌ Áö³ª¸é C±îÁö ÄÑÁö´Â ·¥ÇÁ¸¦ ¿Ï¼ºÇÏ°í ½Í½À´Ï´Ù.

½Ã°£ÀÌ Áö³¯¼ö·Ï ·¥ÇÁ°¡ ´õ ¹à¾ÆÁö´Â ¼ÀÀÌÁö¿ä.



°è¼Ó ÇÏ´Â ÁßÀε¥ ¹®Á¦´Â ¸¸¾à A°¡ ÄÑÁö¸é ±× ´ÙÀ½ºÎÅÏ ÃÊÀ½ÆÄ ¼¾¼­°¡ ¸ÔÅëÀÌ µÈ´Ù´Â °Ì´Ï´Ù¤Ì

±×·¡¼­ Delay¸¦ 30ºÐ Àâ¾Æ³õÀ¸¸é 30ºÐ µ¿¾È ²ø ¼ö°¡ ¾ø°Ô µÇ¼­ ¹®Á¦ÀÔ´Ï´Ù.. 




´ÙÀ½Àº Á¦°¡ Áö±Ý § ÄÚµåÀÔ´Ï´Ù..
5cm¿¡ °®´Ù´ë¸é ÄÑÁö°í, ²¨Áö´Â ÄÚµåÀÔ´Ï´Ù.

¹¹¸¦ ´õ ¾î¶»°Ô Ãß°¡ÇØ¾ß ÇÒ±î¿ä... 
 
timerÇÔ¼ö °®´Ù ¾²¶ó´øµ¥.. ±×°É ¾î¶»°Ô Àû¿ëÇØ¾ß ÇÒ Áö ¸ð¸£°Ú³×¿ä ¤Ì¤Ì
 
 

#define TRIG_PIN 2
#define ECHO_PIN 3
#define LED_PIN 4
#define LED_PIN1 5
#define LED_PIN2 6
byte state;



void setup() { 
  state = LOW;
  pinMode(TRIG_PIN, OUTPUT); 
  pinMode(ECHO_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
    pinMode(LED_PIN1, OUTPUT);
      pinMode(LED_PIN2, OUTPUT);
  Serial.begin(9600);
}
 
void loop() 
{
  int distance = 0; 
  digitalWrite(TRIG_PIN, HIGH);
  delay(1000); 
  digitalWrite(TRIG_PIN, LOW); 
  distance = pulseIn(ECHO_PIN, HIGH)/58.2;


Serial.print(distance);
Serial.println("cm");


     
  if (distance <= 5 ) { 
    if(state == HIGH){
      state = LOW;
      digitalWrite(LED_PIN, LOW);
      digitalWrite(LED_PIN1, LOW);
      digitalWrite(LED_PIN2, LOW);
    } else{
      state = HIGH;
      digitalWrite(LED_PIN, HIGH);
      digitalWrite(LED_PIN1, HIGH);
      digitalWrite(LED_PIN2, HIGH);
    }
  }
}


0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 °ÅÀÇÈ«¸íº¸

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¸¶¸®¾ÈÅëÇϳ׶߰¢ÇÏ

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 °ÅÀÇÈ«¸íº¸

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 °ÅÀÇÈ«¸íº¸
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û ¸ñ·Ïº¸±â