I have this roulette to make for my final school project

So my project is done but whe I turn it on it will only turn on one led, that led isn't supposed to go on, it should spin and land on one number. I will leave the link to the project [here] .(https://create.arduino.cc/projecthub/mircemk/diy-37-led-roulette-game-92912e)
If someone can help me and tell me what is wrong with it.
The code is on the page that i put a link to.

Hello
Post your sketch, well formated, with comments and in so called code tags "</>" and schematic, not a Fritzy diagram, to see how we can help.
Have a nice day and enjoy coding in C++.

 int SER_Pin = 8;   //pin 14 on the 75HC595
int RCLK_Pin = 9;  //pin 12 on the 75HC595
int SRCLK_Pin = 10; //pin 11 on the 75HC595
int buttonPin;
//How many of the shift registers - change this
#define number_of_74hc595s 5

//do not touch
#define numOfRegisterPins number_of_74hc595s * 8

boolean registers[numOfRegisterPins];

int Randomwaarde;
int del = 5 ;
void setup(){
 pinMode(SER_Pin, OUTPUT);
 pinMode(RCLK_Pin, OUTPUT);
 pinMode(SRCLK_Pin, OUTPUT);
  buttonPin = 7; //whatever pin your button is plugged into
  pinMode(buttonPin, INPUT_PULLUP);
 //reset all register pins
 clearRegisters();
 writeRegisters();

 randomSeed(analogRead(3));
 Randomwaarde = random(190, 210);
 Serial.println(Randomwaarde);
}              

//set all register pins to LOW
void clearRegisters(){
 for(int i = numOfRegisterPins - 1; i >=  0; i--){
   registers[i] = LOW;
 }
}

//Set and display registers
//Only call AFTER all values are set how you would like (slow otherwise)
void writeRegisters(){

 digitalWrite(RCLK_Pin, LOW);

 for(int i = numOfRegisterPins - 1; i >=  0; i--){
   digitalWrite(SRCLK_Pin, LOW);

   int val = registers[i];

   digitalWrite(SER_Pin, val);
   digitalWrite(SRCLK_Pin, HIGH);

 }
 digitalWrite(RCLK_Pin, HIGH);

}

//set an individual pin HIGH or LOW
void setRegisterPin(int index, int value){
 registers[index] = value;
}

void loop(){
 //check button pressed, if so enter program condition (inside if statement)
  if(digitalRead(buttonPin) == LOW) //functions based off of button pulling input pin LOW
  {
 for (int x=0; x<=36; x++)
 {
   if (del <= Randomwaarde)
   {
     setRegisterPin(x, HIGH);
     writeRegisters();
     delay(del);
     setRegisterPin(x, LOW);
     writeRegisters();
     del = del +1;
   }
  delay(10000);
  }
 }
}

have you tried your setup ? (post a schematic of the wiring for all the number_of_74hc595s and the button)

can you write a code that lights up one led?

So i tried it and it will only turn on the led that is on number 0 on the wheel. It needs to spin not just to turn one led on. I tried the button also and it doesn’t work

what didn't you get in the question (3rd time you get it)

➜ post a schematic of the wiring for all the number_of_74hc595s and the button

before trying to get your roulette to work, you need to validate that the setup and your key functions do work. ➜ write a simple code that lights up led number 27 for example.

Are you hanging around for 10 seconds over and o er and over and yet seeing nothing?

Try making that something that will let this thing run in your lifetime, like 50.

Just to see what happens.

a7

That’s the code that it came with a video any I just copied it. I will try to change that delay

But when I press the button it doesn’t do anything

Hello
Add Serial.println(xxxxx); at points of interest to the sketch to see what happens.

Can you be more specific? Only Serial.println(xxxxx); ? Or do I need to add more things because when I verify it it shows an error

Hello kevin_grigore
Did you design the sketch and program it?
Do you know what happens in each line of code?
Do you know how to debug a sketch?
If you answered NO 3 times, then you should pick an easier project.
Or what are you expecting here?

I can’t pick an easier project, if you can help me with the code please

buttonPin = 7; //whatever pin your button is plugged into
pinMode(buttonPin, INPUT_PULLUP);

Is your button actually connected to pin7 the way you have indicated in Fritzy picture? Have you tried a simple test sketch which just does a digitalRead() of pin 7 to see if the button is wired correctly and you can see the value change from 1 to 0 when pressed?

No…

What has been suggeseted is to add Serial.println() statements at various places to see what bakes values the variables have at that moment.

So use normal Serial print syntax, with which you seem unfamiliar, so

    Serial.print(“ now the value of foo is “);
    Serial.pirntln(foo);

which I am sure you can adapt to suit the purpose of printing the vakue(s) of the actual variables you have declared in you sketch.

a7

Why? You copied the code from a video anyway, so it’s not your project…

If this is your final project, have you done any other projects? Projects including you writing the code from scratch? Or just projects where you copy code from a video?

The software you copied is flawed. It looks like a few lines of code got dropped along the way to the website where you found it.

You will have to read and understand and fix the mess the author left you with, or contact him to get the real software - the video is def not running the published code.

a7

My roulette works now but it won't rotate constantly, I need to keep the button pressed in order for it to spin. I need some formulas, one for repeating the process( I need to reset the arduino everytime manually in order for it to rotate again from the beginning), another formula for it to run constantly( I need to keep the button pressed in order for it to spin till the end) and one last formula for it to keep the led that it lands on to stay for some seconds on)