看不到代码吗,是不是用手机看的
- int EACONLIGHT = 2;//红色防撞灯,红色, 4个,机腹,机上部,垂尾翼尖
- int POSITIONLIGHT = 3;//航行灯,红绿,常亮主翼尖
- int STROBELIGHT = 4;//爆闪灯两个,主翼尖
- boolean status = true;
- void setup() {
- // put your setup code here, to run once:
- pinMode(12, INPUT);
- pinMode(EACONLIGHT,OUTPUT);
- pinMode(POSITIONLIGHT,OUTPUT);
- pinMode(STROBELIGHT,OUTPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if(status){
- digitalWrite(POSITIONLIGHT, HIGH);//航行灯,常亮
- eaconLightFun();
- strobeLightFun();
- }
- }
- void eaconLightFun(){
- delay(500);
- digitalWrite(EACONLIGHT, HIGH);
- delay(50);
- digitalWrite(EACONLIGHT, LOW);
- }
- void strobeLightFun(){
- delay(1200);
- digitalWrite(STROBELIGHT, HIGH);
- delay(50);
- digitalWrite(STROBELIGHT, LOW);
- delay(50);
- digitalWrite(STROBELIGHT, HIGH);
- delay(50);
- digitalWrite(STROBELIGHT, LOW);
- }
|