Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 19 of 19     «   Prev   16   17   18   19
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,408
Reply with quote  #271 
Angel of Rust you are amazing!
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Angel of Rust

Registered:
Posts: 331
Reply with quote  #272 
Quote:
Originally Posted by Mike Substelny
Angel of Rust you are amazing!


Thanks!

I think I worked out an interesting way to control the lights. I'll post some more detail in the future.


#define EFFECT_EXP1 0
#define EFFECT_EXP2 1
#define EFFECT_ALERT 2
#define EFFECT_LOW 3
#define EFFECT_IDLE 4
float effects_frequency[10] = {0, 0.001, 0.002, 0.004, 0.008, 0.017, 0.034, 0.067, 0.134, 0.268};
int effects_amplitude[5][10] = {
  {0, 0, 180, 80, 60, 40, 40, 40, 20, 20},
  {0, 180, 80, 60, 40, 20, 40, 40, 20, 20},
  {128, 128, 0, 0, 0, 0, 0, 0, 0, 0},
  {30, 30, 10, 20, 20, 30, 5, 5, 5, 0},
  {150, 105, 0, 0, 0, 0, 0, 0, 0, 0}
};
float effects_phase[5][10] = {
  {1.570, 0, 0, 0.100, 0, 0, 0, 0, 0, 0},
  {1.570, -0.200, 0.200, 0.100, -0.100, 0, 0, 0, 0, 0},
  {1.570, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  {1.570, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  {1.570, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
float effects_rand[5][10] = {
  {0, 0, 0, 0.050, 0, 0, 0, 0, 0, 0},
  {0, 0.100, 0.100, 0.050, 0.050, 0, 0, 0, 0, 0},
  {0, 2.000, 0, 0, 0, 0, 0, 0, 0, 0},
  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  {0, 1.000, 0, 0, 0, 0, 0, 0, 0, 0}
};
#define COLOR_IDLE 0
#define COLOR_NORMAL 1
#define COLOR_DOCK 2
#define COLOR_RED 3
#define COLOR_HIT 4
int effects_color[5][3] = {
  {255, 238, 70},    // COLOR_IDLE
  {255, 238, 70},    // COLOR_NORMAL
  {50, 100, 255},     // COLOR_DOCK
  {255, 0, 0},        // COLOR_RED
  {255, 200, 50}      // COLOR_HIT
};
int current_effect = 4;
int current_color = 0;
int current_code = -1;
int panel_color[3] = {0, 0, 0};
float panel_phase[3][10] = {
  {1.570, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  {1.570, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  {1.570, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
int panel_intensity[3][10] = {
  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
int panel_sum[3] = {0, 0, 0};
int generator_step = 0;
#define MAX_GENERATOR_STEP 6

int effects_matrix[5][4] = {
  {-1, 200, EFFECT_IDLE, COLOR_IDLE},        // idle animation (top priority)
  {0, 10, EFFECT_IDLE, COLOR_NORMAL},        // normal running lights (low priority)
  {3, 60, EFFECT_ALERT, COLOR_RED},          // red alert
  {17, 50, EFFECT_ALERT, COLOR_DOCK},        // docking
  {20, 150, EFFECT_EXP1, COLOR_HIT}          // something hits player (high priority)
};

void generate_intensity() {    // code to populate intensity array *********************************************
  float theta = 0;
  unsigned long x = millis() - start_time;
  for (int k=0; k<=MAX_GENERATOR_STEP; k++) {
    for (int i=0; i<=2; i++) {
      theta = effects_frequency[k] * x + panel_phase[i][k];
      panel_intensity[i][k] = 1000 * effects_amplitude[current_effect][k] * sin(theta);
    }
    generator_step++;
  }
  for (int i=0; i<=2; i++) {
    panel_sum[i] = 0;
    for (int j=0; j<= MAX_GENERATOR_STEP; j++) {
      panel_sum[i] = panel_sum[i] + panel_intensity[i][j];
    }
    panel_sum[i] = panel_sum[i] / 1000;
    if (panel_sum[i] > 255) {
      panel_sum[i] = 255;
    }
    if (panel_sum[i] < 0) {
      panel_sum[i] = 0;
    }
  }
  for (int i=0; i<=2; i++) {
    for (int j=0; j<=2; j++) {
      dmx_array[i * 3 + j + 1][0] = panel_sum[i] * effects_color[current_color][j] / 255;
    }
  }
  intensity_generator_count++;
  
}

Angel of Rust

Registered:
Posts: 331
Reply with quote  #273 
Hi all,

Just dropping a note to wish you all well. Here's a soothing video of a leisurely cruise through a sector aboard Normandy:

Angel of Rust

Registered:
Posts: 331
Reply with quote  #274 
Hi all,

Haven't posted anything for a while. I have been working on a side project with this hardware.
crashnburn68

Registered:
Posts: 19
Reply with quote  #275 
Quote:
Originally Posted by Angel of Rust
Hi all,

Haven't posted anything for a while. I have been working on a side project with this hardware.


Don't worry about it man! This thread has grown so much since I joined it years ago - It almost deserves its own wiki/forum at this point. The ventilator looks awesome!

Hope all is well and stay safe!
EricF

Registered:
Posts: 19
Reply with quote  #276 
Just wanted to check in to say that I've been watching this thread in awe of your work, and are wondering how you're doing. Are you in a part of the world that is back to safely playing Artemis IRL? 
Angel of Rust

Registered:
Posts: 331
Reply with quote  #277 
Quote:
Originally Posted by EricF
Just wanted to check in to say that I've been watching this thread in awe of your work, and are wondering how you're doing. Are you in a part of the world that is back to safely playing Artemis IRL? 


Hey there - good to hear from you! It's not really a good idea to meet and play Artemis here yet. I have had a few games with the family at home - so the bridge is still getting use. I've also been working on other hobby stuff at the same time.

Here's a shot of the bridge in permanent setup, with the lights out:
20200827_155009 - Copy.jpg

Angel of Rust

Registered:
Posts: 331
Reply with quote  #278 
Helpful PSA from Angel of Rust:

Remember to let your engineer know what's going on . . . they might not always be able to see the viewscreen!

warp core engineering 20200920.jpg 

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.