9/9 |
좋아요:0 | ||||
---|---|---|---|---|---|
작성자 | 정의철 | 등록일 | 17.09.09 | 조회수 | 69 |
void setup() { pinMode(13,OUTPUT); pinMode(12,OUTPUT); pinMode(11,INPUT_PULLUP); } void loop() { digitalWrite(13,HIGH); delay(50); digitalWrite(13,LOW); delay(50); digitalWrite(12,HIGH); if(digitalRead(11)==0){ digitalWrite(12,1); } else{ digitalWrite(12,0);} } ---------------------------------------------------------------------------------------------------------- void setup() { pinMode(13,OUTPUT); pinMode(12,INPUT_PULLUP); Serial.begin(9600); } void loop() { Serial.println(digitalRead(12)); Serial.print("SW = "); if(digitalRead(12)==0){ digitalWrite(13,1); } else{ digitalWrite(13,0);} } ------------------------------------------------------------------------------------------------------------ |
이전글 | 9/9 |
---|---|
다음글 | 애빈벤터 |