아두이노 LED

돌아다니면서 구한 자료로 공부하는 공간입니다..

틀린부분이 있다면 말씀해주시면 수정하도록 하겠습니다.

※ 남을 비방하거나 욕 / 정치적인 글은 삭제 대상이 됩니다. ※

1 Comments
만키로군 2022.11.15 12:26  
int ledPin = 13;  // LED connected to digital pin 13
int inPin = 7;    // pushbutton connected to digital pin 7
int val = 0;      // variable to store the read value

void setup() {
  pinMode(ledPin, OUTPUT);  // sets the digital pin 13 as output
  pinMode(inPin, INPUT);    // sets the digital pin 7 as input
}

void loop() {
  val = digitalRead(inPin);  // read the input pin
  digitalWrite(ledPin, val);  // sets the LED to the button's value
}
제목