코코아팹은 누구나 창의적 아이디어를 현실로 만들어 낼 수 있도록
만들고, 공유하고, 배울 수 있는 터전이
되고자 합니다.
아이디와 비밀번호를 잊으셨나요?아이디 / 비밀번호 찾기
코코아팹 회원이 아니신가요? 회원가입
2014-08-26 14:16:48
NO | 부품명 | 수량 | 상세정보 |
1 | 아두이노 보드 | 1 | |
2 | 브레드 보드나 전자회로기판 | 1 | |
3 | LED | 27 | |
4 | 저항 | 3 | 330Ω |
5 | 케이블 | 15~20 |
부품명 | 아두이노 보드 | 브레드 보드or 전자회로기판 |
LED | 저항 | 케이블 |
부품사진 |
int layer1 = A0; int layer2 = A1; int layer3 = A2; int D2 = 2; int D3 = 3; int D4 = 4; int D5 = 5; int D6 = 6; int D7 = 7; int D8 = 8; int D9 = 9; int D10 = 10; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(D2, OUTPUT); pinMode(D3, OUTPUT); pinMode(D4, OUTPUT); pinMode(D5, OUTPUT); pinMode(D6, OUTPUT); pinMode(D7, OUTPUT); pinMode(D8, OUTPUT); pinMode(D9, OUTPUT); pinMode(D10, OUTPUT); pinMode(layer1, OUTPUT); pinMode(layer2, OUTPUT); pinMode(layer3, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(layer1, HIGH); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); digitalWrite(D6, HIGH); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, HIGH); digitalWrite(layer3, LOW); digitalWrite(D6, HIGH); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, HIGH); digitalWrite(D6, HIGH); delay(500); digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D6, HIGH); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); delay(500); //east digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D2, LOW); digitalWrite(D3, LOW); digitalWrite(D4, LOW); digitalWrite(D5, HIGH); digitalWrite(D6, HIGH); digitalWrite(D7, HIGH); digitalWrite(D8, HIGH); digitalWrite(D9, HIGH); digitalWrite(D10, HIGH); delay(500); digitalWrite(D2, HIGH); digitalWrite(D3, HIGH); digitalWrite(D4, HIGH); digitalWrite(D5, LOW); digitalWrite(D6, LOW); digitalWrite(D7, LOW); digitalWrite(D8, HIGH); digitalWrite(D9, HIGH); digitalWrite(D10, HIGH); delay(500); digitalWrite(D2, HIGH); digitalWrite(D3, HIGH); digitalWrite(D4, HIGH); digitalWrite(D5, HIGH); digitalWrite(D6, HIGH); digitalWrite(D7, HIGH); digitalWrite(D8, LOW); digitalWrite(D9, LOW); digitalWrite(D10, LOW); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); delay(500); //west digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D2, HIGH); digitalWrite(D3, HIGH); digitalWrite(D4, HIGH); digitalWrite(D5, HIGH); digitalWrite(D6, HIGH); digitalWrite(D7, HIGH); digitalWrite(D8, LOW); digitalWrite(D9, LOW); digitalWrite(D10, LOW); delay(500); digitalWrite(D2, HIGH); digitalWrite(D3, HIGH); digitalWrite(D4, HIGH); digitalWrite(D5, LOW); digitalWrite(D6, LOW); digitalWrite(D7, LOW); digitalWrite(D8, HIGH); digitalWrite(D9, HIGH); digitalWrite(D10, HIGH); delay(500); digitalWrite(D2, LOW); digitalWrite(D3, LOW); digitalWrite(D4, LOW); digitalWrite(D5, HIGH); digitalWrite(D6, HIGH); digitalWrite(D7, HIGH); digitalWrite(D8, HIGH); digitalWrite(D9, HIGH); digitalWrite(D10, HIGH); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); delay(500); //south digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D2, LOW); digitalWrite(D3, HIGH); digitalWrite(D4, HIGH); digitalWrite(D5, LOW); digitalWrite(D6, HIGH); digitalWrite(D7, HIGH); digitalWrite(D8, LOW); digitalWrite(D9, HIGH); digitalWrite(D10, HIGH); delay(500); digitalWrite(D2, HIGH); digitalWrite(D3, LOW); digitalWrite(D4, HIGH); digitalWrite(D5, HIGH); digitalWrite(D6, LOW); digitalWrite(D7, HIGH); digitalWrite(D8, HIGH); digitalWrite(D9, LOW); digitalWrite(D10, HIGH); delay(500); digitalWrite(D2, HIGH); digitalWrite(D3, HIGH); digitalWrite(D4, LOW); digitalWrite(D5, HIGH); digitalWrite(D6, HIGH); digitalWrite(D7, LOW); digitalWrite(D8, HIGH); digitalWrite(D9, HIGH); digitalWrite(D10, LOW); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); delay(500); //north digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D2, HIGH); digitalWrite(D3, HIGH); digitalWrite(D4, LOW); digitalWrite(D5, HIGH); digitalWrite(D6, HIGH); digitalWrite(D7, LOW); digitalWrite(D8, HIGH); digitalWrite(D9, HIGH); digitalWrite(D10, LOW); delay(500); digitalWrite(D2, HIGH); digitalWrite(D3, LOW); digitalWrite(D4, HIGH); digitalWrite(D5, HIGH); digitalWrite(D6, LOW); digitalWrite(D7, HIGH); digitalWrite(D8, HIGH); digitalWrite(D9, LOW); digitalWrite(D10, HIGH); delay(500); digitalWrite(D2, LOW); digitalWrite(D3, HIGH); digitalWrite(D4, HIGH); digitalWrite(D5, LOW); digitalWrite(D6, HIGH); digitalWrite(D7, HIGH); digitalWrite(D8, LOW); digitalWrite(D9, HIGH); digitalWrite(D10, HIGH); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); delay(500); for(int i=0; i<2; i++) { digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D2, HIGH); digitalWrite(D3, LOW); digitalWrite(D4, HIGH); digitalWrite(D5, LOW); digitalWrite(D6, LOW); digitalWrite(D7, LOW); digitalWrite(D8, HIGH); digitalWrite(D9, LOW); digitalWrite(D10, HIGH); delay(500); digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D2, LOW); digitalWrite(D3, HIGH); digitalWrite(D4, LOW); digitalWrite(D5, HIGH); digitalWrite(D6, HIGH); digitalWrite(D7, HIGH); digitalWrite(D8, LOW); digitalWrite(D9, HIGH); digitalWrite(D10, LOW); delay(500); } //all ON OFF for(int i=0; i<2; i++) { digitalWrite(layer1, HIGH); digitalWrite(layer2, HIGH); digitalWrite(layer3, HIGH); digitalWrite(D2, LOW); digitalWrite(D3, LOW); digitalWrite(D4, LOW); digitalWrite(D5, LOW); digitalWrite(D6, LOW); digitalWrite(D7, LOW); digitalWrite(D8, LOW); digitalWrite(D9, LOW); digitalWrite(D10, LOW); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); delay(500); } }
digitalWrite(layer1, HIGH); digitalWrite(layer2, LOW); digitalWrite(layer3, LOW); digitalWrite(D6, HIGH); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, HIGH); digitalWrite(layer3, LOW); digitalWrite(D6, HIGH); delay(500); digitalWrite(layer1, LOW); digitalWrite(layer2, LOW); digitalWrite(layer3, HIGH); digitalWrite(D6, HIGH); delay(500);
수박쨈