2011.04.04


준비물
아두이노 칩 or 아트메가 168 외 아트메가들
아두이노 프로그램
LED 6개
버튼 6개
10k 저항 6개
점퍼케이블


결과





회로도

 





아두이노 코드

int LED[] = {8,9,10,11,12,13}; // LED
int SEN[] = {2,3,4,5,6,7}; // 버튼
int count;

void setup(){
  //Serial.begin(9600);
  for (count=0;count<6;count++) {
    pinMode(LED[count], OUTPUT); //led setup 6EA
    pinMode(SEN[count], INPUT);  // 버튼 setup 6EA
    // digitalWrite(LED[count],LOW); // setting LOW
  }
}

void loop() {
  for(count=0; count<6; count++){
     digitalWrite(LED[count], digitalRead(SEN[count]));
  }
}



'S artworks > Arduino' 카테고리의 다른 글

Interaction Light - [ awake ]  (1) 2011.12.16
아두이노 - 버튼을 눌러 LED 제어하기 . 02  (0) 2011.04.11

+ Recent posts