Help with Ghostbusters Reboot Displays

Hi! I bought an arduino controlled reboot proton pack display kit from spongeface (GhostLab42) on ebay and I've got 'em installed and set up, but I have a problem or two. Main issue being: I've got no idea how to have two scripts/programs run, one after the other, but not do the first section more than once.

Here's the library for the displays: GitHub - jaredpetersen/ghostlab42reboot: 👻 Arduino library for GhostLab42's Reboot Triple-Display Board Set
Here's my body/idle code for the time being (removed the first "bootup" part)

void loop()
{
 reboot.write(0, "120824");
   reboot.write(1, "1984");
   reboot.write(2, "14-D");
   delay(1250);

   reboot.write(0, "120825");
    reboot.write(1, "1989");
   reboot.write(2, "1804");
    delay(1250);

    reboot.write(0, "120826");
    reboot.write(1, "2009");
   reboot.write(2, "2010");
    delay(1250);

    reboot.write(0, "120825");
    reboot.write(1, "2016");
   reboot.write(2, "SPLT");
    delay(1250);

    reboot.write(0, "120822");
    reboot.write(1, "2021");
   reboot.write(2, "CRSH");
    delay(1250);

    reboot.write(0, "120823");
    reboot.write(1, "2024");
   reboot.write(2, "BOWE");
    delay(1250);
}

And here's the part I wanna toss before it.

void loop()
{
      reboot.write(1, "BOOT");
   reboot.write(2, "14-D");
// String to be scrolled across the six digit display
  // Need the extra spaces to make the scrolling smooth
  String displayText = "      Booting Secondary Systems     HolsTech      ";

  // Commence scrolling
  for (int i = 0; i < displayText.length(); i++)
  {
    reboot.write(0, displayText.substring(i, i + 6));
    delay(250);
  }

  // Clear and start over
  reboot.resetDisplay(0);
}

To be clear! I have a rudimentary experience with arduino, I had an elegoo UNO clone already and used that to run these displays, but I'm still completely lost and have next to no programming knowledge.
I just wanna have the second code block here run a single time, then run the first block looping for as long as the arduino/displays are running.

Unless there’s more than you’re telling,
put the initial code to [run once] in setup(), and leave the ‘continuous’ code in loop().

Welcome to the forum

I have no idea what you are talking about generally, but if you have code that you want to run once at startup then put it in the setup() function. Code that should be repeated goes in the loop() function

I’m pretty clueless about this system. Is the setup just a spot for a script to run before the loop runs or is it more in depth?

Your sketch has at least two functions in it. One is named setup() and the other is named loop()

You have posted two loop() functions, each of which has code in it that will run repeatedly but I have not looked at it

A function has the following components

loop()   //the name of the function
{            //start of the code in the function
            //the code for the function goes here
}           //end of the code of the function

You can see that in the loop() functions that you posted. Your sketch will have a setup() function made up of the same components. Please post that here

They are each from entire programs, that i cobbled together and changed a couple bits of. They each have their own setup scripts, one writing to the 4 digit displays and one adjusting brightness, though I plan to only use the writing to displays part. I believe it will run the way I want if I slap the scrolling script into setup as well.

@thepackdoctor - describe your idea as if I can not see. It seems your sketchs rapidly changes 7-segment displays (six-wide, four-wide, four-wide) and scrolls a few letters... but does not brighten or display time. Maybe you can hand-draw your idea?

For reference:

Jittery numbers sketch: ghostlab42reboot/examples/ex1_basictest/ex1_basictest.ino at master · jaredpetersen/ghostlab42reboot · GitHub

Scroll sketch: ghostlab42reboot/examples/ex3_scrollingtext/ex3_scrollingtext.ino at master · jaredpetersen/ghostlab42reboot · GitHub

Brightness sketch. ghostlab42reboot/examples/ex2_brightness/ex2_brightness.ino at master · jaredpetersen/ghostlab42reboot · GitHub

Edit your post and add it in, please.

So you have two general sections: one that executes once, never to return once you leave it: void setup(){}; and the other program that runs from start to finish, over and over forever void loop(){}.

You can't strictly speaking make two programs run in the way you're thinking about it without void loop() somehow addressing even the part you want to ignore on subsequent iterations of that loop.

But you can certainly block sections off, go deeper within nested loops, break out or even seemingly stop the loop such as while(1); - but even that while() loop still loops within itself; that is, doesn't actually halt the program.

Think about layers of an onion as opposed to extending the length of a track, when you want to do more than one "program" at a time. Those other programs you would usually call as functions: you might have one called

void blastSlimer(){
 // do the thing that blasts Onionhead
}

and just call that function within the main program like so:

blastSlimer();

Make up a whole bunch of these if you like and, using your human input thing (it is buttons?), create states of a general machine, conceptually in your case, a proton blaster.

The following sketch shows one way to approach this idea using just your Arduino and you typing numbers in the Serial Monitor, and prints back the sort of feedback you might expect if you added in all the real equipment. This shows one outer layer of an onion, if you will, but you could build state machines within each state, and substituting the Serial user input for your buttons or whatever.

char mode;
const int light = 3;
const int pump = 4;
const int fan = 5;

void setup() {
  Serial.begin(115200);
  pinMode(light, OUTPUT);
  pinMode(pump, OUTPUT);
  pinMode(fan, OUTPUT);
  Serial.println(F("charDrivenStateMachine"));
  Serial.println();
  Serial.println(F("Type 0-7 to change functions"));
  Serial.println();
  mode = '0';  // start state variable at mode 0
  modeZero();  // let us know and init devices to off
}

void loop() {
  if (Serial.available() > 0) {
    mode = Serial.read();
    switch (mode) {
      case '0':
        modeZero();
        break;
      case '1':
        modeOne();
        break;
      case '2':
        modeTwo();
        break;
      case '3':
        modeThree();
        break;
      case '4':
        modeFour();
        break;
      case '5':
        modeFive();
        break;
      case '6':
        modeSix();
        break;
      case '7':
        modeSeven();
        break;
    }
  }
}

void modeZero() {
  Serial.println("mode 0");
  Serial.println("light off, pump off, fan off");
  Serial.println("");
  allOff();
}
void modeOne() {
  Serial.println("mode 1");
  Serial.println("light on, pump on, fan on");
  Serial.println("");
  allOn();
}
void modeTwo() {
  Serial.println("mode 2");
  Serial.println("light on, pump on, fan off");
  Serial.println("");
  lightAndPump();
}
void modeThree() {
  Serial.println("mode 3");
  Serial.println("light off, pump on, fan on");
  Serial.println("");
  fanAndPump();
}
void modeFour() {
  Serial.println("mode 4");
  Serial.println("light on, pump off, fan on");
  Serial.println("");
  lightAndFan();
}
void modeFive() {
  Serial.println("mode 5");
  Serial.println("light on, pump off, fan off");
  Serial.println("");
  justLight();
}
void modeSix() {
  Serial.println("mode 6");
  Serial.println("light off, pump on, fan off");
  Serial.println("");
  justPump();
}
void modeSeven() {
  Serial.println("mode 7");
  Serial.println("light off, pump off, fan on");
  Serial.println("");
  justFan();
}
void allOff() {
  digitalWrite(light, LOW);
  digitalWrite(pump, LOW);
  digitalWrite(fan, LOW);
}
void allOn() {
  digitalWrite(light, HIGH);
  digitalWrite(pump, HIGH);
  digitalWrite(fan, HIGH);
}
void lightAndPump() {
  digitalWrite(light, HIGH);
  digitalWrite(pump, HIGH);
  digitalWrite(fan, LOW);
}
void fanAndPump() {
  digitalWrite(light, LOW);
  digitalWrite(pump, HIGH);
  digitalWrite(fan, HIGH);
}
void lightAndFan() {
  digitalWrite(light, HIGH);
  digitalWrite(pump, LOW);
  digitalWrite(fan, HIGH);
}
void justLight() {
  digitalWrite(light, HIGH);
  digitalWrite(pump, LOW);
  digitalWrite(fan, LOW);
}
void justPump() {
  digitalWrite(light, LOW);
  digitalWrite(pump, HIGH);
  digitalWrite(fan, LOW);
}
void justFan() {
  digitalWrite(light, LOW);
  digitalWrite(pump, LOW);
  digitalWrite(fan, HIGH);
}

There is a great video I encourage you to watch as state machines (and state change detection) are two critical concepts to understand when approaching projects that have some semblance to beyond very basic movie props or video games.

As a super amateur hobbyist myself with no background in electronics, Arduino, coding - the state machine approach was the "aha" concept that took me from blinking an LED to blinking and LED while doing something else but only sometimes when I really wanted it to. Clear as mud?

The library is designed for easy programming via copy/paste. You don’t have to use all of them, so I just wanna use scroll and basictext

It is in, below, the second code block.

No. Libraries are designed to simplify lower-level programming with higher-level functions, called (programming) abstraction.

Please, describe the presentation you have in mind. Do not use your vague slang. That only causes poor communication of your idea.