/*
 * @Author: dugulingping
 * @Date: 2022-04-14 17:39:45
 * @LastEditTime: 2022-06-17 23:19:00
 * @LastEditors: dugulingping
 * @Description: ButtonLED
 * @FilePath: \test\ButtonLED\ButtonLED.ino
 */
#define LED 2
#define LED2 5
#define BUTTON 12
void setup(){
  pinMode(LED,OUTPUT);
  pinMode(LED2,OUTPUT);
  pinMode(BUTTON,INPUT_PULLUP);
  
  digitalWrite(LED,HIGH);

}
void loop(){
    if(digitalRead(BUTTON)==LOW){
        digitalWrite(LED,LOW);
        digitalWrite(LED2,HIGH);
    }
    else{
        digitalWrite(LED,HIGH);
        digitalWrite(LED2,LOW);
    }
} 