김유민gledel
Published

01 Digital/Analogue INPUT/OUTPUT

Bongilcheon High School Fab Lab Academy

IntermediateProtip509
01 Digital/Analogue INPUT/OUTPUT

Things used in this project

Story

Read more

Schematics

untitled_sketch_01_ILl6fFF6hU.fzz

Code

Untitled file

Arduino
int led_pin = 13;
int sw_pin1 = 2;
int sw_pin2 = 8;
int sw1_value;
int sw2_value;

void setup(){
  pinMode(led_pin, OUTPUT);
  pinMode(sw_pin1, INPUT);
  pinMode(sw_pin2, INPUT);
}

void loop(){
  sw1_value = digitalRead(sw_pin1);
  sw2_value = digitalRead(sw_pin2);
  if(sw1_value == LOW){
    digitalWrite(led_pin, HIGH);
}
  if(sw2_value == HIGH){
    digitalWrite(led_pin, HIGH);
}
  digitalWrite(led_pin, LOW);
}

Credits

김유민
9 projects • 2 followers
" Never do things others can do and will do if there are things others cannot do or will not do. "
gledel
100 projects • 116 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"

Comments