An Amusement Machine using LEDs

OK Excellent, thanks for sticking with me Mike -

Yes I forgot I was learning C program and kept searching using Arduino as a search term...
Lots more relevant C tutorials out there.

Here is my latest attempt... Its not working. I can't seem to work out how to call up the stop flash symbol as it is a product of the spin function, so the spin function has to run and produce the spinCount which is not in the scope of this function... Its a variable (I tried declaring it as int. stopSymbol, didn't fly)... how do I call a variable made in another function?

Plus the spin function is still running on a matrix index of [0][spinCount] which is row 1 and we need a generalised form - I guess another variable to declare?

//multi-array of 3 reels of 25 symbols made up of 10 different tokens
byte symbols[3][25] = {
  {2, 3, 2, 4, 5, 6, 3, 2, 7, 2, 8, 9, 3, 4, 5, 2, 3, 2, 10, 2, 11, 2, 3, 9, 5 },
  {10, 4, 9, 2, 3, 4, 9, 5, 6, 4, 9, 7, 8, 4, 9, 11, 9, 3, 5, 9, 5, 3, 2, 9, 4 },
  {10, 4, 9, 2, 3, 4, 9, 5, 6, 4, 9, 7, 8, 4, 9, 11, 9, 3, 5, 9, 5, 3, 2, 9, 4 }
};

byte wheel[3] = {0, 0, 0}; //wheel array for storing the stop token for three reel spins


void setup() {
  for (int i = 2; i < 12; i++) { // declare pin numbers for 10 symbols
    pinMode(i, OUTPUT); //declare pins as outputs
  }
  pinMode(15, INPUT_PULLUP); //declare pin 15 as an input with 5V pullup resitor

}

void loop() {
  Serial.begin(9600);

  int j = wheel[0];
  int i = spin();

  
  for (int j = 0; j < 3 ; j++ ) {  //calling up 3 wheels indexing through matrix rows

    for (int i = 0; i < 3; i ++) {  //calling up spin and flashing symbol passed up from spin function
      flash(200, 200, stopSymbol);
    }

  }

  while (1) { } // stop, press reset to start
}
// flash function calls up each token LED & turns on then off

void flash( int onTime, int offTime, byte token)  {
  digitalWrite(token, HIGH); // will turn on the LED
  delay(onTime); // so you can see it
  digitalWrite(token, LOW); // will turn off the LED
  delay(offTime); // so you can see it off
}

int spin() {
  // loop along 25 smbol row in array
  static int spinCount = 0;

  // waiting...
  while (digitalRead(15) == HIGH) { } // do nothing until the switch is moved
  // spin action starts here
  while (digitalRead(15) == LOW) { //checking if input remains high before advancing count

    spinCount += 1;

    if (spinCount == 25) spinCount = 0; //Checking if variable spinCount needs wrapping around
    flash(600, 200, symbols[0][spinCount]); // quick flash for each moving symbol

    Serial.print(spinCount);
    if (spinCount == 0) Serial.println(" "); //start a new line on printout
  }
int. stopSymbol = symbols[0][spinCount]
  return stopSymbol; // send back the symbol/token it landed on
}