LED navigation lights can someone help me modify this code

Howdy. I recently bought and assembled a arduino micro to control navigation lights on my RC plane. I managed to get the beacon code working, but I want to make the wing tip strobes well, strobe. They just flash half a second on half a second off. I want a flash pattern like this.

My code is this:

int brightness = 0;
int fadeAmount = 5;
const int ledPin = 9;
int ledState = LOW;
long previousMillis = 0;
long interval = 500;
void setup() {
pinMode(10,OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
}
void loop() {
//beacon
analogWrite(10, brightness);
brightness = brightness + fadeAmount;
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}
delay(30);
//beacon
//nav
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
//nav
//strobe
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
previousMillis = currentMillis;
if (ledState == LOW)
ledState = HIGH;
else
ledState = LOW;
digitalWrite(ledPin, ledState);
}
//strobe
}

Im willing to reassign pins to my wingtip lights if someone re did this code. Or commented something in.

Thanks, SageHillsPilot

Take the code you have, run it through the Auto Format tool (In the Arduino IDE, Ctrl + T) and post it using the CODE tags to at least make it readable.

If you want a strobe effect, you can change the value of “interval” when you change the state of the strobe LED.
I’d like to lose the “delay()” too.

One thing is this:

  if (ledState == LOW)
    ledState = HIGH;
  else
    ledState = LOW;

First of all, never use if statments without {}. Yes it is valid for a single line, but it makes code difficult to follow and allows mistakes to creep in.

Secondly, that snippet of code can be replaced with just:

ledState = !ledState;

Secondly, that snippet of code can be replaced with just:

It can, but you may as well use the "if" to change the value of "interval" at the same time.

I'm on a iPad I just need a edited code preferribly if someone did it for me I'm completely new to this code and sourced this off the Internet and made some basic changes

If you're on an iPad , then how are you going to compile it?

So if you’re not interested in doing the work yourself and would rather pay to have someone do it for you, you should probably try the Gigs and Collaboration section, or did you think these help forums are filled with people, just waiting to write code for anyone that asks?