/*
  文件名称：LED_Relay.ino
  功能：LED闪烁+继电器开启
*/

#define PIN_LED   16
#define PIN_RELAY1 5
#define PIN_RELAY2 4

void setup() 
{
 pinMode(PIN_LED, OUTPUT);        //输出模式
 pinMode(PIN_RELAY1, OUTPUT);      //输出模式  
 pinMode(PIN_RELAY2, OUTPUT);      //输出模式
 digitalWrite(PIN_LED,HIGH);      //LED默认关闭
 digitalWrite(PIN_RELAY1,LOW );   //继电器默认关闭
}

void loop() 
{
  digitalWrite(PIN_LED, LOW);    //打开LED    
  digitalWrite(PIN_RELAY1,HIGH ); 
  digitalWrite(PIN_RELAY2,HIGH );    
  delay(1000); //延时1S
  digitalWrite(PIN_LED, HIGH);   //关闭LED
  digitalWrite(PIN_RELAY1,LOW ); 
  digitalWrite(PIN_RELAY2,LOW );
  delay(1000); //延时1S
}
