#include <Adafruit_NeoPixel.h>
#define PIN 19
#define PIX 402
Adafruit_NeoPixel strip(PIX, PIN, NEO_GRB + NEO_KHZ800);
int npn[] = {72, 134}; // (N)acelle
int nsn[] = {4, 62};
int fpnv[] = {135, 135}; // (F)ormation
int fsnv[] = {63, 63};
int fshv[] = {136, 136};
int fpsd[] = {382, 384};
int fpsv[] = {360, 362};
int fssd[] = {353, 355};
int fssv[] = {360, 362};
int fbsd[] = {366, 368};
int fbsv[] = {369, 371};
int tpsrt[] = {385, 387}; // (T)hruster
int tpsft[] = {372, 374};
int tssrt[] = {350, 352};
int tssft[] = {363, 365};
int issi[] = {356, 359}; // (I)mpulse
int ipsi[] = {378, 381};
int ishi[] = {0, 3};
int shuttle[] = {388, 389};
int bridge[] = {390, 402};
int ppshd[] = {70, 71}; // (P)haser
int ppshv[] = {68, 69};
int psshd[] = {64, 65};
int psshv[] = {66, 67};
int sdr[] = {137, 273}; // (R)ing
int svr[] = {274, 349};
void setup() {
strip.begin();
lightup(sdr, 224, 224, 224); // gry
lightup(svr, 255, 255, 255); // wht
lightup(nsn, 0, 255, 255); // mag
lightup(npn, 0, 255, 255); // mag
lightup(bridge, 255, 0, 0); // red
strip.show();
}
unsigned long timer, timeout = 1000;
int group, groupsize = 5; // NFTIP
void loop() {
if (millis() - timer >= timeout) {
timer = millis();
f_lights();
}
}
void f_lights() {
int mainlights[] = {136, 366, 367, 368, 369, 370, 371 };
int portlights[] = {135, 375, 376, 377, 382, 383, 384 };
int stbdlights[] = {63, 353, 354, 355, 360, 361, 362, };
for (int i = 0; i < sizeof(mainlights) / sizeof(mainlights[0]); i++) {
strip.setPixelColor(mainlights[i], strip.Color(255, 255, 0 ));
strip.setPixelColor(portlights[i], strip.Color(255, 0, 0));
strip.setPixelColor(stbdlights[i], strip.Color(0, 255, 0));
}
strip.show();
delay(500);
for (int i = 0; i < sizeof(mainlights) / sizeof(mainlights[0]); i++) {
strip.setPixelColor(mainlights[i], strip.Color(0, 0, 0));
strip.setPixelColor(portlights[i], strip.Color(0, 0, 0));
strip.setPixelColor(stbdlights[i], strip.Color(0, 0, 0));
strip.show();
}
}
void lightup(int pixels[], byte r, byte g, byte b) {
for (int i = pixels[0]; i < pixels[1] + 1; i++) // add one. array shows "first" and "last"
strip.setPixelColor(i, strip.Color(r, g, b));
}
/*
https://forum.arduino.cc/t/powering-multiple-led-strips/1445827/32
https://www.universostartrek.com/Star_Trek_USS_Enterprise_NCC_1701_D_Blueprints.htm
- Nacelles LEDS (122 pix)
port nacelles 63 72..134 *
starboard nacelles 59 4..62 *
-Formation (21 pix)
port nacelle ventral 1 135 *
starboard nacelle ventral 1 63 *
secondary hull ventral 1 136 *
port saucer dorsal 3 382..384 *
port saucer ventral 3 375..377 *
starboard saucer dorsal 3 353..355 *
starboard saucer ventral 3 360..362 *
bow saucer dorsal 3 366..368 *
bow saucer ventral 3 369..371 *
-Thrusters (12 pix)
port saucer rear thruster 3 385..387 *
port saucer forward thruster 3 372..374 *
starboard saucer rear thruster 3 350..352 *
starboard saucer forward thruster 3 363..365 *
-Impulse engines (12 pix)
starboard saucer impulse 4 356..359 *
port saucer impulse 4 378..381
secondary hull impulse 4 0..3 *
-Shuttle bay 2 388..389 *
-Bridge 12 390..401 *
-Phasers (8)
port secondary hull dorsal 2 70..71 *
port secondary hull ventral 2 68..69 *
starboard secondary hull dorsal 2 64..65 *
starboard secondary hull ventral 2 66..67 *
saucer dorsal ring 137 137..273 *
saucer ventral ring 76 274..349 *
total leds 402 (137+76+8+12+2+12+12+21+122)
*/4..62
63
72..134
136
137..273
0..3
390..402
274..349
350..352
68..69
66..67
70..71
64..65
135
356..359
363..365
366..368
369..371
372..374
378..381
385..387
388..389
BRIDGE
SHUTTLE
(P)PSHV
(P)PSHD
(P)SSHD
(P)SSHV
(F)PNV
(I)SHI
(N)PN
(N)SN
(T)PSRT
(T)SSRT
(T)PSFT
(T)SSFT
(I)PSI
(I)SSI
SDR
(F)SHV
(F)SNV
(F)BSV
(F)BSD
(F)SSD
353..355
(F)SSV
360..362
(F)PSD
(F)PSV
SVR
375..377
382..384