LED켜기
void setup() { pinMode(13 , OUTPUT); pinMode(10 , INPUT_PULLUP); pinMode(4 , OUTPUT); pinMode(7, INPUT_PULLUP); Serial.begin(9600);
}
void loop() {if(digitalRead(10)==0){ digitalWrite(13, HIGH); Serial.print("a="); Serial.println(digitalRead(10));}else { digitalWrite(13 , LOW);} if(digitalRead(7)==0){ digitalWrite(4 , HIGH); Serial.print("b="); Serial.println(digitalRead(7)); } else { digitalWrite(4 , LOW); } }