'motorSequence' was not declared in this scope

Hoping I can get some help. I copied this code from one of the projects that my daughter picked and got the error listed in the subject. I plan on practicing coding with her but I want her to see what’s possible so she will be interested. Any idea what I need to do?

void setup() {
int directionPin = 4;
int motorPins[4] = {0, 1, 2, 3};
byte motorSequence[8] = {B1000, B1100, B0100, B0110, B0010, B0011, B0001, B1001};
int motorDirection = 0;
int motorSpeed = 2; // Lower is faster.
//byte motorSequence[8] = {B0111,B0011,B1011,B1001,B1101,B1100,B1110,B0110};
//byte motorSequence[8] = {B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001};
}

void stepMotor(byte motorDirection, int stepSpeed) {
int readStep = 0;
int readBit = 0;
int HIGHLOW = 0;
for (readStep = 0; readStep < 8; readStep++) {
for (readBit = 0; readBit < 4; readBit++) {
HIGHLOW = bitRead(motorSequence[readStep], readBit);[/color]
digitalWrite(motorPins[abs((motorDirection * 3) - readBit)], HIGHLOW);
}
delay(stepSpeed);
}
}

void stopMotor() {
int readBit = 0;
for (readBit = 0; readBit < 4; readBit++) {
digitalWrite(motorPins[readBit], LOW);
}
}

void setup() {
pinMode(motorPins[0], OUTPUT);
pinMode(motorPins[1], OUTPUT);
pinMode(motorPins[2], OUTPUT);
pinMode(motorPins[3], OUTPUT);
pinMode(directionPin, INPUT);
}

int pressed = 1;

void loop() {
while (digitalRead(directionPin) == 1) {
pressed = 1;
stepMotor(abs(motorDirection - 1), motorSpeed);
}
if (pressed == 1) {
stopMotor();
motorDirection = abs(motorDirection - 1);
pressed = 0;
} else {
stepMotor(motorDirection, motorSpeed);
}
}

}

void loop() {
// put your main code here, to run repeatedly:

}

You declared motorSequence inside your setup() function, which makes it local to that function. That means you can't also use it in the stepMotor() function. If you want to use it in both the setup() and stepMotor() functions then you should make motorSequence global by defining it above the setup() function.

More information:
https://www.arduino.cc/reference/en/language/variables/variable-scope--qualifiers/scope/

You also have multiple setup and loop functions defined. That's not allowed.