Need help: my code dosen't work on my uno

A friend wrote me a code for my arduino uno, now I want to delete the card reader, but I run into a lot of issues.

Please help, it's for a university project.
Thanks for collaboration :purple_heart:

MORE INFO ABOUT THE PROJECT
The code need to do this:
1) Run a simple 8bit music and a random color to leds;
2) Select a random led (that must be associate with a limit switch);
3) If the you select and close the right limit switch, the led tuns green, if it's not correct, the led turn red;
4) The code must do the random with the limit switch that are not closed; when they are all closed it comes to last part;
5) The last part is the music that let you know the game is done.

THE CODE THEY GAVE TO ME
#include <FastLED.h> // https://fastled.io/
#include <Adafruit_PN532.h>
#include "pitches.h"

const int numLed = 8;

const int pinLed = A0;
CRGB leds[numLed];
const int qualiLed[numLed] = {0, 1, 2, 3, 4, 5, 6, 7};

const int pinFineCorsa[numLed] = {12, 11, 10, 9, 8, 7, 6, 5};

// buzzer
//                      0        1         2        3         4        5        6         7        8         9       10        11       12
const int suoni`[]` = {NOTE_C4, NOTE_CS4, NOTE_D4, NOTE_DS4, NOTE_E4, NOTE_F4, NOTE_FS4, NOTE_G4, NOTE_GS4, NOTE_A4, NOTE_AS4, NOTE_B4, NOTE_C5};
//                     DO        DO#      RE       RE#        MI       FA      FA#        SOL      SOL#     LA       LA#       SI       DO
const int suoniFinali[][4] = {
  {suoni[2], suoni[2], suoni[0], suoni[0]},  // nessun led verde
  {suoni[0], suoni[0], suoni[2], suoni[2]},  // un led verde
  {suoni[2], suoni[0], suoni[2], suoni[2]},  // due led verdi
  {suoni[5], suoni[7], suoni[9], suoni[12]}, // tutti led verdi
};
const int pinBuzzer = 4;

const int rfidReset = 3;

void setup() {
  Serial.begin(9600);
  delay(2000);
  Serial.println("INIZIO");


  FastLED.addLeds<WS2811, pinLed, RGB>(leds, numLed);
  for (int i = 0 ; i < numLed ; i++) leds[i] = CRGB::Black;
  FastLED.show();
  Serial.println("LED OK");


  for (int i = 0 ; i < numLed ; i++) pinMode(pinFineCorsa[i], INPUT_PULLUP);
  Serial.println("IN OK");

}

void loop() {
  //  testLed();
  //  testSuono();
  //  testFinecorsa();
    testRFID();

  gioco();
}

void testFinecorsa() {
  for (int i = 0 ; i < numLed ; i++) {
    Serial.print(digitalRead(pinFineCorsa[i]));
    Serial.print(" ");
  }
  Serial.println();
}

void gioco() {
  Serial.println("INIZIO GIOCO");

  for (int i = 0 ; i < numLed ; i++) {
    leds[i] = CHSV(random(255), 255, 255);
    FastLED.show();
  }

  suona(2);

  for (int i = 0 ; i < numLed ; i++) leds[i] = CRGB::Black;
  FastLED.show();


  while (!testRFID());
  // todo identificare la tessera

tesseraMessa:

  int numeroEstratto;
  while (digitalRead(pinFineCorsa[numeroEstratto = random(numLed)]) == LOW);
  bool giusto = false;

  leds[qualiLed[numeroEstratto]] = CRGB::White;
  FastLED.show();

  while (!giusto) {
    for (int i = 0 ; i < numLed ; i++) {
      if (digitalRead(pinFineCorsa[i]) == LOW) {
        if (i == numeroEstratto) {
          leds[qualiLed[numeroEstratto]] = CRGB::Green;
          giusto = true;
          FastLED.show();
          suona(3);
          delay(2000);
        } else {
          giusto = false;
          suona(0);
          delay(2000);
        }
      }
    }
  }

  delay(5000);
  goto tesseraMessa;

  // e se ci sono tutti i finecorsa chiusi?

}

void testLed() {
  Serial.println("TEST LED");
  leds[0] = CRGB(255, 0, 0);
  leds[1] = CRGB(0, 255, 0);
  leds[2] = CRGB(0, 255, 0);
  leds[3] = CRGB(0, 0, 255);
  leds[4] = CRGB(0, 0, 255);
  leds[5] = CRGB(0, 0, 255);
  leds[6] = CRGB(random(255), random(255), random(255));
  delay(100);
  FastLED.show();
}

void testSuono() {
  Serial.println("TEST SUONO");
  for (int i = 0 ; i < 4 ; i++) {
    suona(i);
    delay(1000);
  
  }

}

void suona(int _s) {
  for (byte j = 0 ; j < 4 ; j++) {
    tone(pinBuzzer, suoniFinali[_s][j]);
    delay(90);
  }
  delay(140);
  noTone(pinBuzzer);
  delay(1000);
}Testo preformattato

Is there not a screen that shows up asking that the code be properly posted? Is it not visible enough? It seems nearly universally ignored?

Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
code tags new

So you had a friend do your homework and now you are asking us to finish it?
I appreciate your honesty!

I hope it is not computer science homework. The goto will get OP an F. :rofl:

That is his friend trying to bash him...

You may have realized by now that no one will do it for you. I suggest that you post your attempt at doing what you want (in code tags, thank you).

Then tell us what the code does and how that differs from what you want.

If there are errors and/or warnings, please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

Then we will be happy to guide you in getting the code to do what you want.

And they are . . ?

Hi marcomanti,

welcome to the Arduino-Forum.

So far you have posted only very few informations.
Based on the informations you give every user paints a picture of you.
The more information you post the better the picture will match with reality and the better answers can be adapted to your knowledge level.

As you can see from the answers you created a picture of
marcomanti seems to be lazy and wants help without own effort.
This might not be true. It is up to you to add information to modify your picture.

best regards Stefan

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.