Newbie needs assistance

okay, found this.

for(brightness=0;brightness<=255;brightness+=5) {
    //Fade out red led value counts down from 255 to 0
    analogWrite(RedPin,255-brightness);
    //Fade in the green one value counts up
    analogWrite(OrangePin,brightness);
    delay(30);

but I have no idea how to integrate that into my code

NOW HAS ARDUINO BOARD!!!!!

went out and bought a board today. Still need to hook up the leds to actually test the program though.

heres the program with the pin definitions set correctly for PWM and the multicolor fade defines noted to be an RGB instead (RGB's on an arduino only use 1 pin right?)

#define DIGITAL_ON(pin) digitalWrite(pin, LOW) //digital on, active low
#define DIGITAL_OFF(pin) digitalWrite(pin, HIGH) //digital off, active low

//define pins
#define PRIMARY 1 
#define SECONDARY 2
#define DEFLECTORRGB 3 //fade = ORANGE STANDBY BLUE WARP
#define SHUTTLEBAY 4
#define NECELLSRGB 5 //fade VIOLET STANDBY BLUE WARP
#define IMPULSEON 6 //fade
#define SHUTTLEBAYDOORS 7
#define FLOODLIGHT 8
#define IMPULSEORANGE 9 //fade
 #define TORPEDO 10 //FADE
#define RCS 11 //FADE
#define NAVIGATION 12
#define STROBES 13
#define SHUTTLEBAYLANDING 0

//FADE PROGRAMMING - ASSIGN _FADE TO DEFINE

//pin functions
#define PRIMARY_ON() DIGITAL_ON(PRIMARY)
#define SECONDARY_ON() DIGITAL_ON(SECONDARY)
#define DEFLECTORORANGE_ON() DIGITAL_ON(DEFLECTORORANGE)
#define DEFLECTORBLUE_ON() DIGITAL_ON(DEFLECTORBLUE)
#define NECELLS_ON() DIGITAL_ON(NECELLS)
#define IMPULSE_ON() DIGITAL_ON(IMPULSE)
#define SHUTTLEBAY_ON() DIGITAL_ON(SHUTTLEBAY)
#define SHUTTLEBAYDOORS_ON() DIGITAL_ON(SHUTTLEBAYDOORS)
#define SHUTTLEBAYLANDING_ON() DIGITAL_ON(SHUTTLEBAYLANDING)
#define RCS_ON() DIGITAL_ON(RCS)
#define FLOODLIGHT_ON() DIGITAL_ON(FLOODLIGHT)
#define NAVIGATION_ON() DIGITAL_ON(NAVIGATION)
#define STROBES_ON() DIGITAL_ON(STROBES)
#define TORPEDO_ON() DIGITAL_ON(TORPEDO)

#define PRIMARY_OFF() DIGITAL_OFF(PRIMARY)
#define SECONDARY_OFF() DIGITAL_OFF(SECONDARY)
#define DEFLECTOR_OFF() DIGITAL_OFF(DEFLECTOR)
#define NECELLS_OFF() DIGITAL_OFF(NECELLS)
#define IMPULSE_OFF() DIGITAL_OFF(IMPULSE)
#define SHUTTLEBAY_OFF() DIGITAL_OFF(SHUTTLEBAY)
#define SHUTTLEBAYDOORS_OFF() DIGITAL_OFF(SHUTTLEBAYDOORS)
#define SHUTTLEBAYLANDING_OFF() DIGITAL_OFF(SHUTTLEBAYLANDING)
#define RCS_OFF() DIGITAL_OFF(RCS)
#define FLOODLIGHT_OFF() DIGITAL_OFF(FLOODLIGHT)
#define NAVIGATION_OFF() DIGITAL_OFF(NAVIGATION)
#define STROBES_OFF() DIGITAL_OFF(STROBES)
#define TORPEDO_OFF() DIGITAL_OFF(TORPEDO)

#define LED_BLINK(pin, duration) do {LED_ON(pin); delay(duration); LED_OFF(pin);} while (0) //blink a pin for a given duration

int brightness = 5;
int fadeAmount = 5;
#define duration_1s 1000ul //define 1 second, in ms
#define duration_2s (duration_1s * 2) //2 second delay
#define duration_3s (duration_1s * 3) //3 second delay
#define duration_4s (duration_1s * 4) //4 second delay
#define duration_5s (duration_1s * 5) //5 second delay

//perform stage 1 activities - startup
void stage1_startup(void) {
  DIGITAL_ON(PRIMARY);
  delay (duration_1s);
  DIGITAL_ON(SECONDARY);
  delay (duration_1s);
  DIGITAL_ON(DEFLECTORORANGE) (brightness, 3); //needs to fade to 50% on
  delay (duration_2s);
  DIGITAL_ON(NECELLSVIOLET); //fade on to 50%
  DIGITAL_ON(IMPULSEON)(brightness, 3); //fade on to 50%
  DIGITAL_ON(RCS)(brightness, 3); //fade on to 50%
  delay (duration_3s);
  DIGITAL_ON(SHUTTLEBAYDOORS);
  delay (duration_5s);
  DIGITAL_OFF(SHUTTLEBAYDOORS);
  delay (duration_1s);
  DIGITAL_ON(SHUTTLEBAY);
  delay (duration_1s);
  DIGITAL_ON(SHUTTLEBAYLANDING);
  delay (duration_1s);
  DIGITAL_ON(FLOODLIGHT);
  delay (duration_1s);
  DIGITAL_ON(NAVIGATION);
  DIGITAL_ON(STROBES);
  delay (duration_1s);
  DIGITAL_ON(TORPEDO) (brightness, 3); //fade on to 50%
  delay (duration_5s);} 
  
  //perform stage 2 activities - Impulse power
  void stage2_impulse_power(void) {
  DIGITAL_ON(DEFLECTORORANGE); //fade on to 100%
  DIGITAL_ON(IMPULSEON) (brightness, 5); //fade on to 100%
  DIGITAL_ON (NECELLSVIOLET); //fade on to 100% violet
  DIGITAL_ON(RCS) (brightness, 5); //fade on to 100%
  DIGITAL_ON(TORPEDO) (brightness,5); //fade on to 100%
  DIGITAL_ON(SHUTTLEBAY);
  DIGITAL_ON(SHUTTLEBAYLANDING);}  
  
  //perform stage 3 activities - warp power
  void stage3_warp_power(void) {
    DIGITAL_ON(SHUTTLEBAYDOORS);
    delay (duration_5s);
    DIGITAL_OFF(SHUTTLEBAYDOORS);
    DIGITAL_OFF(SHUTTLEBAY);
    DIGITAL_OFF(SHUTTLEBAYLANDING);
    delay (duration_2s);
    DIGITAL_ON(DEFLECTORBLUE);; //fade off violet and on blue with transition
    DIGITAL_ON(IMPULSEORANGE);; //fade off red and on orange with transition
    DIGITAL_ON(NECELLSVIOLET); //fade off
    DIGITAL_ON(NECELLSBLUE); //fade on
    DIGITAL_ON(RCS) (brightness,3); //fade down to 50%
    DIGITAL_ON(TORPEDO) (brightness, 3);} //fade down to 50%
  
  
  //perform stage 4 activities
  void stage4(void) {
    DIGITAL_ON(SHUTTLEBAYDOORS);
    delay (duration_5s);
    DIGITAL_OFF(SHUTTLEBAYDOORS);}
    
      
  //perform stage 5 activities
  void stage5(void) {
    DIGITAL_OFF(SHUTTLEBAYLANDING);
    delay (duration_1s);
    DIGITAL_OFF(SHUTTLEBAY);
    DIGITAL_OFF(NECELLSVIOLET);
    delay (duration_1s);
    DIGITAL_OFF(NECELLSBLUE);
    delay (duration_1s);
    DIGITAL_OFF(TORPEDO);
    delay (duration_1s);
    DIGITAL_OFF(IMPULSEON);
    DIGITAL_OFF(IMPULSEORANGE);
    delay (duration_1s);
    DIGITAL_OFF(RCS);
    delay (duration_1s);
    DIGITAL_OFF(DEFLECTORBLUE);
    DIGITAL_OFF(DEFLECTORORANGE);
    delay (duration_1s);
    DIGITAL_OFF(SECONDARY);
    delay (duration_1s);
    DIGITAL_OFF(PRIMARY);
    delay (duration_1s);
    DIGITAL_OFF(FLOODLIGHT);}

Should I be concerned with this

Enterprise_program_2.ino: In function 'void stage1_startup()':
Enterprise_program_2:68: error: void value not ignored as it ought to be
Enterprise_program_2:71: error: void value not ignored as it ought to be
Enterprise_program_2:72: error: void value not ignored as it ought to be
Enterprise_program_2:87: error: void value not ignored as it ought to be
Enterprise_program_2.ino: In function 'void stage2_impulse_power()':
Enterprise_program_2:93: error: void value not ignored as it ought to be
Enterprise_program_2:95: error: void value not ignored as it ought to be
Enterprise_program_2:96: error: void value not ignored as it ought to be
Enterprise_program_2.ino: In function 'void stage3_warp_power()':
Enterprise_program_2:112: error: void value not ignored as it ought to be
Enterprise_program_2:113: error: void value not ignored as it ought to be

at the moment? These lines all match up to (brightness_X) commands and I dont have it programmed for the brightness and fade effects yet.

Will the program still run its course for testing it and do i need to get rid of the "VOID" tags?

Heres with the navigation and strobe code.

Can someone please help me incorporate the strobe and navigation into the main program?

It only needs to activated once and run for the entire program until manually powered off. They activate in stage 1 activities but I cant find anything on incorporating it with the main program.

#define DIGITAL_ON(pin) digitalWrite(pin, LOW) //digital on, active low
#define DIGITAL_OFF(pin) digitalWrite(pin, HIGH) //digital off, active low

//define pins
#define PRIMARY 1 
#define SECONDARY 2
#define DEFLECTORRGB 3 //fade = ORANGE STANDBY BLUE WARP
#define SHUTTLEBAY 4
#define NECELLSRGB 5 //fade VIOLET STANDBY BLUE WARP
#define IMPULSEON 6 //fade
#define SHUTTLEBAYDOORS 7
#define FLOODLIGHT 8
#define IMPULSEORANGE 9 //fade
 #define TORPEDO 10 //FADE
#define RCS 11 //FADE
#define NAVIGATION 12
#define STROBES 13
#define SHUTTLEBAYLANDING 0

//FADE PROGRAMMING - ASSIGN _FADE TO DEFINE

//NAVIGATION PROGRAMMING
int NAVIGATIONS = 12;
void setup() {                
  pinMode(NAVIGATION, OUTPUT);     
}
void loop() {
  digitalWrite(NAVIGATION, HIGH);
  delay(500);
  digitalWrite(NAVIGATION, LOW);
  delay(3000);}
  
//STROBE PROGRAMMING
int STROBE = 13;
void setup() {                
  pinMode(STROBES, OUTPUT);     
}
void loop() {
  digitalWrite(STROBES, HIGH);
  delay(100);
  digitalWrite(STROBES, LOW);
  delay(2000);}

//pin functions
#define PRIMARY_ON() DIGITAL_ON(PRIMARY)
#define SECONDARY_ON() DIGITAL_ON(SECONDARY)
#define DEFLECTORORANGE_ON() DIGITAL_ON(DEFLECTORORANGE)
#define DEFLECTORBLUE_ON() DIGITAL_ON(DEFLECTORBLUE)
#define NECELLS_ON() DIGITAL_ON(NECELLS)
#define IMPULSE_ON() DIGITAL_ON(IMPULSE)
#define SHUTTLEBAY_ON() DIGITAL_ON(SHUTTLEBAY)
#define SHUTTLEBAYDOORS_ON() DIGITAL_ON(SHUTTLEBAYDOORS)
#define SHUTTLEBAYLANDING_ON() DIGITAL_ON(SHUTTLEBAYLANDING)
#define RCS_ON() DIGITAL_ON(RCS)
#define FLOODLIGHT_ON() DIGITAL_ON(FLOODLIGHT)
#define NAVIGATION_ON() DIGITAL_ON(NAVIGATION)
#define STROBES_ON() DIGITAL_ON(STROBES)
#define TORPEDO_ON() DIGITAL_ON(TORPEDO)

#define PRIMARY_OFF() DIGITAL_OFF(PRIMARY)
#define SECONDARY_OFF() DIGITAL_OFF(SECONDARY)
#define DEFLECTOR_OFF() DIGITAL_OFF(DEFLECTOR)
#define NECELLS_OFF() DIGITAL_OFF(NECELLS)
#define IMPULSE_OFF() DIGITAL_OFF(IMPULSE)
#define SHUTTLEBAY_OFF() DIGITAL_OFF(SHUTTLEBAY)
#define SHUTTLEBAYDOORS_OFF() DIGITAL_OFF(SHUTTLEBAYDOORS)
#define SHUTTLEBAYLANDING_OFF() DIGITAL_OFF(SHUTTLEBAYLANDING)
#define RCS_OFF() DIGITAL_OFF(RCS)
#define FLOODLIGHT_OFF() DIGITAL_OFF(FLOODLIGHT)
#define NAVIGATION_OFF() DIGITAL_OFF(NAVIGATION)
#define STROBES_OFF() DIGITAL_OFF(STROBES)
#define TORPEDO_OFF() DIGITAL_OFF(TORPEDO)

#define LED_BLINK(pin, duration) do {LED_ON(pin); delay(duration); LED_OFF(pin);} while (0) //blink a pin for a given duration

int brightness = 5;
int fadeAmount = 5;
#define duration_1s 1000ul //define 1 second, in ms
#define duration_2s (duration_1s * 2) //2 second delay
#define duration_3s (duration_1s * 3) //3 second delay
#define duration_4s (duration_1s * 4) //4 second delay
#define duration_5s (duration_1s * 5) //5 second delay

//perform stage 1 activities - startup
void stage1_startup(void) {
  DIGITAL_ON(PRIMARY);
  delay (duration_1s);
  DIGITAL_ON(SECONDARY);
  delay (duration_1s);
  DIGITAL_ON(DEFLECTORRGB) (brightness, 3); //needs to fade to 50% on
  delay (duration_2s);
  DIGITAL_ON(NECELLSRGB); //fade on to 50%
  DIGITAL_ON(IMPULSEON)(brightness, 3); //fade on to 50%
  DIGITAL_ON(RCS)(brightness, 3); //fade on to 50%
  delay (duration_3s);
  DIGITAL_ON(SHUTTLEBAYDOORS);
  delay (duration_5s);
  DIGITAL_OFF(SHUTTLEBAYDOORS);
  delay (duration_1s);
  DIGITAL_ON(SHUTTLEBAY);
  delay (duration_1s);
  DIGITAL_ON(SHUTTLEBAYLANDING);
  delay (duration_1s);
  DIGITAL_ON(FLOODLIGHT);
  delay (duration_1s);
  DIGITAL_ON(NAVIGATION);
  DIGITAL_ON(STROBES);
  delay (duration_1s);
  DIGITAL_ON(TORPEDO) (brightness, 3); //fade on to 50%
  delay (duration_5s);} 
  
  //perform stage 2 activities - Impulse power
  void stage2_impulse_power(void) {
  DIGITAL_ON(DEFLECTORRGB); //fade on to 100%
  DIGITAL_ON(IMPULSEON) (brightness, 5); //fade on to 100%
  DIGITAL_ON (NECELLSRGB); //fade on to 100% violet
  DIGITAL_ON(RCS) (brightness, 5); //fade on to 100%
  DIGITAL_ON(TORPEDO) (brightness,5); //fade on to 100%
  DIGITAL_ON(SHUTTLEBAY);
  DIGITAL_ON(SHUTTLEBAYLANDING);}  
  
  //perform stage 3 activities - warp power
  void stage3_warp_power(void) {
    DIGITAL_ON(SHUTTLEBAYDOORS);
    delay (duration_5s);
    DIGITAL_OFF(SHUTTLEBAYDOORS);
    DIGITAL_OFF(SHUTTLEBAY);
    DIGITAL_OFF(SHUTTLEBAYLANDING);
    delay (duration_2s);
    DIGITAL_ON(DEFLECTORRGB);; //fade off violet and on blue with transition
    DIGITAL_ON(IMPULSEORANGE);; //fade off red and on orange with transition
    DIGITAL_ON(NECELLSRGB); //fade off
    DIGITAL_ON(NECELLSRGB); //fade on
    DIGITAL_ON(RCS) (brightness,3); //fade down to 50%
    DIGITAL_ON(TORPEDO) (brightness, 3);} //fade down to 50%
  
  
  //perform stage 4 activities
  void stage4(void) {
    DIGITAL_ON(SHUTTLEBAYDOORS);
    delay (duration_5s);
    DIGITAL_OFF(SHUTTLEBAYDOORS);}
    
      
  //perform stage 5 activities
  void stage5(void) {
    DIGITAL_OFF(SHUTTLEBAYLANDING);
    delay (duration_1s);
    DIGITAL_OFF(SHUTTLEBAY);
    DIGITAL_OFF(NECELLSRGB);
    delay (duration_1s);
    DIGITAL_OFF(NECELLSRGB);
    delay (duration_1s);
    DIGITAL_OFF(TORPEDO);
    delay (duration_1s);
    DIGITAL_OFF(IMPULSEON);
    DIGITAL_OFF(IMPULSEORANGE);
    delay (duration_1s);
    DIGITAL_OFF(RCS);
    delay (duration_1s);
    DIGITAL_OFF(DEFLECTORRGB);
    DIGITAL_OFF(DEFLECTORRGB);
    delay (duration_1s);
    DIGITAL_OFF(SECONDARY);
    delay (duration_1s);
    DIGITAL_OFF(PRIMARY);
    delay (duration_1s);
    DIGITAL_OFF(FLOODLIGHT);}

Have you tried compiling that? Is there some reason you have two sets of setup() and loop() functions?

dxw00d:
Have you tried compiling that? Is there some reason you have two sets of setup() and loop() functions?

Theres 2 sets of loop and setups because its stock code from the examples with the timings adjusted to meet my needs but I dont know how to add it into my program so it works, so I have left it as standard for now until someone can help me work it into the program.

Should I be concerned with this

You should be concerned with all error / warning messages: the compiler is trying to tell you something about your code.

Enterprise_program_2.ino: In function 'void stage1_startup()':
Enterprise_program_2:68: error: void value not ignored as it ought to be
Enterprise_program_2:71: error: void value not ignored as it ought to be

No one is going to go through your code and count which lines these messages are about. You have to help us help you.

It only needs to activated once and run for the entire program until manually powered off.

That sounds like part of your setup.

I dont know how to add it into my program so it works,

Rather than diving into a project right away, I think you can go a lot faster if you slow down and read a few books / manuals about programming and the environment / ide.

I dont learn by reading. I learn by doing things and when I come against a wall, asking for help. Books cannot hold me and get bored far to quickly. I also struggle absorbing information from them.

I need the strobes and navigation lights to come on at a certain point within the startup sequence, so i guess i need to program in the strobe and blink rates and then link a trigger of some sort to it?

But thats beyond me at the moment so will need help there.

the error messages are here. sorry for not being in code tags, bold wont work with them in place.

#define NAVIGATION_OFF() DIGITAL_OFF(NAVIGATION)
#define STROBES_OFF() DIGITAL_OFF(STROBES)
#define TORPEDO_OFF() DIGITAL_OFF(TORPEDO)
//this blank line is regiserting as an error
#define LED_BLINK(pin, duration) do {LED_ON(pin); delay(duration); LED_OFF(pin);} while (0) //blink a pin for a given duration

int brightness = 5;
int fadeAmount = 5;
#define duration_1s 1000ul //define 1 second, in ms
#define duration_2s (duration_1s * 2) //2 second delay
#define duration_3s (duration_1s * 3) //3 second delay
#define duration_4s (duration_1s * 4) //4 second delay
#define duration_5s (duration_1s * 5) //5 second delay

//perform stage 1 activities - startup
void stage1_startup(void) {
DIGITAL_ON(PRIMARY);
delay (duration_1s);
DIGITAL_ON(SECONDARY);
** delay (duration_1s);**
DIGITAL_ON(DEFLECTORRGB) (brightness, 3); //needs to fade to 50% on
delay (duration_2s);
DIGITAL_ON(NECELLSRGB); //fade on to 50%
DIGITAL_ON(IMPULSEON)(brightness, 3); //fade on to 50%
DIGITAL_ON(RCS)(brightness, 3); //fade on to 50%
** delay (duration_3s);**
DIGITAL_ON(SHUTTLEBAYDOORS);
delay (duration_5s);
** DIGITAL_OFF(SHUTTLEBAYDOORS);**
delay (duration_1s);
DIGITAL_ON(SHUTTLEBAY);
delay (duration_1s);
DIGITAL_ON(SHUTTLEBAYLANDING);
delay (duration_1s);
DIGITAL_ON(FLOODLIGHT);
delay (duration_1s);
DIGITAL_ON(NAVIGATION);
DIGITAL_ON(STROBES);
delay (duration_1s);
DIGITAL_ON(TORPEDO) (brightness, 3); //fade on to 50%
delay (duration_5s);}

//perform stage 2 activities - Impulse power
void stage2_impulse_power(void) {
DIGITAL_ON(DEFLECTORRGB); //fade on to 100%
** DIGITAL_ON(IMPULSEON) (brightness, 5); //fade on to 100%**
** DIGITAL_ON (NECELLSRGB); //fade on to 100% violet**

I learn by doing things

That approach works for exceptionally gifted people.

That's why they have books for the rest of us mortals.

//this blank line is regiserting as an error

What is the error message? How was the macro invoked? ...

Enterprise_program_2.ino: In function 'void stage1_startup()':
Enterprise_program_2:72: error: void value not ignored as it ought to be
Enterprise_program_2:75: error: void value not ignored as it ought to be
Enterprise_program_2:76: error: void value not ignored as it ought to be
Enterprise_program_2:91: error: void value not ignored as it ought to be
Enterprise_program_2.ino: In function 'void stage2_impulse_power()':
Enterprise_program_2:97: error: void value not ignored as it ought to be
Enterprise_program_2:99: error: void value not ignored as it ought to be
Enterprise_program_2:100: error: void value not ignored as it ought to be
Enterprise_program_2.ino: In function 'void stage3_warp_power()':
Enterprise_program_2:116: error: void value not ignored as it ought to be
Enterprise_program_2:117: error: void value not ignored as it ought to be

those are only error messages, including for the blank line.

You probably want to learn about debugging yourself, reading a book or not.

But it looks like the compiler is complaining about DIGITAL_ON() and DIGITAL_OFF(): the 2nd the last invokation of DIGITAL_ON() takes three parameters and is clearly in contradiction with others invocations of DIGITAL_ON/OFF.

dhenry:
You probably want to learn about debugging yourself, reading a book or not.

But it looks like the compiler is complaining about DIGITAL_ON() and DIGITAL_OFF(): the 2nd the last invokation of DIGITAL_ON() takes three parameters and is clearly in contradiction with others invocations of DIGITAL_ON/OFF.

sorry, that made no sense at all.

i fixed it anyway.

but this is far more concerning!

core.a(main.cpp.o): In function `main':
C:\Users\gaming\Documents\Arduino\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to `setup'
C:\Users\gaming\Documents\Arduino\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'
DIGITAL_ON(IMPULSEON) (brightness, 5); //fade on to 100%

becomes

digitalWrite(6, LOW)  (brightness, 5);

What is the '(brightness, 5)' supposed to do?

Personally, I would recommend you get rid of all the macros, and just write some normal functions.

dxw00d:

DIGITAL_ON(IMPULSEON) (brightness, 5); //fade on to 100%

becomes

digitalWrite(6, LOW)  (brightness, 5);

What is the '(brightness, 5)' supposed to do?

Personally, I would recommend you get rid of all the macros, and just write some normal functions.

i ditched the brightness parts for now, they will need to be programed in properly later on though when I work out how to define brightness levels for all the lights. which you've supplied the answer to it would appear. thanks :slight_smile:

any ideas on this though?

core.a(main.cpp.o): In function `main':
C:\Users\gaming\Documents\Arduino\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to `setup'
C:\Users\gaming\Documents\Arduino\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'

as thats what the compiler is chucking out now.

You have to have setup() and loop() functions in your sketch. I get that you don't like studying manuals, I'm the same myself, but if you haven't already done so, I'd recommend at least looking at some of the example sketches in the IDE, to get some understanding of the structure.

ahhh i see! So the defines are basically the setup as its instructions on what things do, so the loop....i'll go work that out.

thank you :smiley:

just to update, i have stage 1 activities working as far as being on or off.

I went back to the beginning and re-wrote it all using one of the examples.

Next i need to make adjustments for brightness levels.

int strobes = 13;
int navigation = 12;
int rcs = 11;
int torpedo = 10;
int shuttlebaylanding = 9;
int floodlight = 8;
int shuttlebaydoors = 7;
int impulsergb = 6;
int necellsrgb = 5;
int shuttlebay = 4;
int deflectorrgb = 3;
int secondary = 2;
int primary = 1;


void setup() {                
  pinMode(strobes, OUTPUT);  
  pinMode(navigation, OUTPUT);
  pinMode(rcs, OUTPUT);
  pinMode(torpedo, OUTPUT);
  pinMode(shuttlebaylanding, OUTPUT);
  pinMode(floodlight, OUTPUT);
  pinMode(shuttlebaydoors, OUTPUT);
  pinMode(impulsergb, OUTPUT);
  pinMode(shuttlebay, OUTPUT);
  pinMode(deflectorrgb, OUTPUT);
  pinMode(secondary, OUTPUT);
  pinMode(primary, OUTPUT);
  pinMode(necellsrgb, OUTPUT);
}

//STAGE 1 STARTUP
void loop() {
  digitalWrite(primary, HIGH);   
  delay(1000);               
  digitalWrite(secondary, HIGH);   
  delay(1000);               
  digitalWrite(deflectorrgb, HIGH);    //fade on to 50% orange
  delay(1000);
  digitalWrite(necellsrgb, HIGH);   //fade on to 50% violet
  delay(1000);               
  digitalWrite(impulsergb, HIGH);    //fade on to 50% orange
  delay(1000);
  digitalWrite(rcs, HIGH);   //fade on to 50%
  delay(1000);               
  digitalWrite(shuttlebaydoors, HIGH);    
  delay(5000);
  digitalWrite(shuttlebaydoors, LOW);   
  digitalWrite(shuttlebay, HIGH);    
  delay(1000);
  digitalWrite(shuttlebaylanding, HIGH);   
  delay(1000);               
  digitalWrite(floodlight, HIGH);    
  delay(1000);
  digitalWrite(navigation, HIGH);   
  delay(1000);           
  digitalWrite(strobes, HIGH);   
  delay(1000);               
  digitalWrite(torpedo, HIGH);    
  delay(1000);    
  
  //STAGE 2 IMPULSE POWER
  digitalWrite(deflectorrgb, HIGH);    //fade on to 100% orange
  delay(1000);
  digitalWrite(necellsrgb, HIGH);   //fade on to 100 violet%
  delay(1000);               
  digitalWrite(impulsergb, HIGH);    //fade on to 100% red
  delay(1000);
  digitalWrite(rcs, HIGH);   //fade on to 100%
  delay(1000);               
  digitalWrite(shuttlebay, HIGH);    
  delay(1000);
  digitalWrite(shuttlebaylanding, HIGH);   
  delay(1000);               
  digitalWrite(torpedo, HIGH);    
  delay(600000);  

//STAGE 3 WARP POWER
  digitalWrite(deflectorrgb, LOW);    //fade on to 100% BLUE
  delay(1000);
  digitalWrite(necellsrgb, LOW);   //fade on to 100% BLUE
  delay(1000);               
  digitalWrite(impulsergb, LOW);    //fade TO 100% ORANGE
  delay(1000);
  digitalWrite(rcs, LOW);   //fade OFF
  delay(1000);               
  digitalWrite(shuttlebaydoors, HIGH);    
  delay(5000);
  digitalWrite(shuttlebaydoors, LOW);   
  digitalWrite(shuttlebay, LOW);    
  delay(1000);
  digitalWrite(shuttlebaylanding, LOW);   
  delay(1000);               
  digitalWrite(torpedo, LOW);    //FADE TO 50%
  delay(600000);      
  
  
 //STAGE 4 SHUTDOWN
 digitalWrite(primary, LOW);   
  delay(1000);               
  digitalWrite(secondary, LOW);   
  delay(1000);               
  digitalWrite(deflectorrgb, LOW);    //fade on to 50%
  delay(1000);
  digitalWrite(necellsrgb, LOW);   //fade on to 50%
  delay(1000);               
  digitalWrite(impulsergb, LOW);    //fade on to 50% orange
  delay(1000);
  digitalWrite(rcs, LOW);   //fade on to 50%
  delay(1000);               
  digitalWrite(shuttlebaydoors, HIGH);    
  delay(5000);
  digitalWrite(shuttlebaydoors, LOW);   
  digitalWrite(shuttlebay, LOW);    
  delay(1000);
  digitalWrite(shuttlebaylanding, LOW);   
  delay(1000);               
  digitalWrite(floodlight, LOW);    
  delay(1000);
  digitalWrite(navigation, LOW);   
  delay(1000);           
  digitalWrite(strobes, LOW);   
  delay(1000);               
  digitalWrite(torpedo, LOW);    
  delay(1000);    
}

Can someone show me how a 50% fade should be written into that program? the tutorials all go on about fading just a singular or multiple leds but not how to code it into a larger program.

Such as the RCS needs a 50% fade. if someone can help me write in a 50% fade for it then i can work out the rest for the 100% fades and so on throughout the remainder of it.

also, thats my new code. the first just didnt really work out haha.

AWOL:
analogWrite() - Arduino Reference

I managed to work out setting the brightness levels, but the fade simply will not work.

does it actually require a POT on that specific LED and thats why its not working? Theres a few that need to vary between 0% 50% and 100%

this is why i asked for an example of fade code bedded into other light control. I am also going to have this issue with the navigation and strobe lights.
They are bedded into the main program but need to blink on a loop, so is there a way to loop certain parts of the program and it carry on with the rest of the program while this loop goes on until told to stop?

The other thing is, this

int brightness = 10;
int fadeAmount = 10;
nalogWrite(deflectorrgb, 5);    //fade on to 50% orange
  delay(1000);

then later its

analogWrite(deflectorrgb, 10);    //fade on to 100% orange
  delay(1000);

but the brightness of the led does not change during the cycles. the bit in bolt is what I'm interested in at the moment as well as the "not fading" issue.

They are bedded into the main program

Sorry, I see words, but I don't see anything that means anything to me.

analogWrite only works on half a dozen pins, and then only if you're not doing anything with the associated timers