How to control multiple led speed and brigthness with 2 potentiometer

Hello guys I've been working on basic project to control 4 different color led with 2 potentiometer to change speed and brigthness but everytime I'm failing in coding part if someone guide me I'd be appreciated.

int sensorValue = 0;[color=#222222][/color]
int green = 10;[color=#222222][/color]
int red = 9;[color=#222222][/color]
int blue = 6;[color=#222222][/color]
int white = 5;[color=#222222][/color]
int val = 255;[color=#222222][/color]
int lav = 0;[color=#222222][/color]
int buttonA = 12;[color=#222222][/color]
int buttonState1 = 0;[color=#222222][/color]
int buttonB = 11;[color=#222222][/color]
int buttonState2 = 0;[color=#222222][/color]
[color=#222222][/color]
void setup()[color=#222222][/color]
{[color=#222222][/color]
  pinMode(green, OUTPUT);[color=#222222][/color]
  pinMode(red, OUTPUT);[color=#222222][/color]
  pinMode(blue, OUTPUT);[color=#222222][/color]
  pinMode(white, OUTPUT);[color=#222222][/color]
  [color=#222222][/color]
  pinMode(buttonA, INPUT);[color=#222222][/color]
  pinMode(buttonB, INPUT);[color=#222222][/color]
}[color=#222222][/color]
[color=#222222][/color]
void loop()[color=#222222][/color]
{[color=#222222][/color]
  int val = analogRead(0);[color=#222222][/color]
  int lav = analogRead(0);[color=#222222][/color]
  [color=#222222][/color]
  buttonState1 = digitalRead(buttonA);[color=#222222][/color]
  if(buttonState1 == HIGH) {[color=#222222][/color]
    [color=#222222][/color]
    lav = lav + 50;[color=#222222][/color]
    [color=#222222][/color]
    analogWrite(10,lav);[color=#222222][/color]
    analogWrite(9,lav);[color=#222222][/color]
    analogWrite(6,lav);[color=#222222][/color]
    analogWrite(5,lav);[color=#222222][/color]
  }[color=#222222][/color]
  [color=#222222][/color]
  buttonState2 = digitalRead(buttonB);[color=#222222][/color]
  if(buttonState2 == HIGH) {[color=#222222][/color]
    [color=#222222][/color]
    val = val - 50:[color=#222222][/color]
    analogWrite(10,lav);[color=#222222][/color]
    analogWrite(9,lav);[color=#222222][/color]
    analogWrite(6,lav);[color=#222222][/color]
    analogWrite(5,lav);[color=#222222][/color]
  }[color=#222222][/color]
  [color=#222222][/color]
  analogWrite(green, HIGH);[color=#222222][/color]
  sensorValue = analogRead(0);[color=#222222][/color]
  delay(sensorValue + 500);[color=#222222][/color]
  analogWrite(green, LOW);[color=#222222][/color]
  delay(1000);[color=#222222][/color]
  [color=#222222][/color]
   analogWrite(red, HIGH);[color=#222222][/color]
  sensorValue = analogRead(0);[color=#222222][/color]
  delay(sensorValue + 500);[color=#222222][/color]
  analogWrite(red, LOW);[color=#222222][/color]
  delay(1000);[color=#222222][/color]
  [color=#222222][/color]
   analogWrite(blue, HIGH);[color=#222222][/color]
  sensorValue = analogRead(0);[color=#222222][/color]
  delay(sensorValue + 500);[color=#222222][/color]
  analogWrite(blue, LOW);[color=#222222][/color]
  delay(1000);[color=#222222][/color]
  [color=#222222][/color]
   analogWrite(white, HIGH);[color=#222222][/color]
  sensorValue = analogRead(0);[color=#222222][/color]
  delay(sensorValue + 500);[color=#222222][/color]
  analogWrite(white, LOW);[color=#222222][/color]
  delay(1000);[color=#222222][/color]
[color=#222222][/color]
  [color=#222222][/color]
}[color=#222222][/color]

in this code instead of 2 potentiometer there is 1 button can someone help me to reorganize the code instead of button can you help me to add second potentiometer to control brigthness and speed.

Post what you’ve got.

Dont link to another site, this is how you post an image or schematic

How to make a schematic you can post.

I just change it thank you for warning.

analogWrite(red, HIGH);

HIGH has the value 1.
Depending on how your LED is wired, that’s very bright, or not very bright at all.

my circuit:

OK well done to post the schematic. Next step is to post code as a codescetion

  1. open your code in the Arduino-IDE
  2. press Ctrl.t for autoformatting your code
  3. do a right-click with your mouse and choose "copy for forum"
  4. press-alt-tab to change back to your browser
  5. press ctrl-v to insert the clipboard-content into the "write-post-field"
  6. add a detailed description what your code does and how it deviates from what you like the code to do

best regards Stefan

P.S.: I allow myself a comment about Autodesk the "manufacturer" of TinkerCAD

Autodesk has a very agressive marketing strategy to sell their products. The agression is well hidden.
They offer tinkercad and programming arduinos to gain new users. Make them used to their software.

Though wether this online-version of a programming IDE nor their online-CAD tinkercad and nor their CAD-software fusion 360 is the most productive.

If you ever have taken a look into IronCAD you will see that IronCAD is much more intuitive and get you up going doing complex constructions in a few hours and needing just half the time over any other CAD-software to finish your construction, because it is really 3D-orientated. No need to do any 2D-sketches like in fusion or any other CAD-software. No restrictions about the sequence how to construct anything complex.
This is what makes IronCAD really outstanding. If you are a student you can have a one-year licence for free. WHich can be extended as long as you are a student.

int sensorValue = 0;
int green = 10; 
int red = 9; 
int blue = 6; 
int white = 5; 
int val = 255;
int lav = 0;
int buttonA = 12;
int buttonState1 = 0;
int buttonB = 11;
int buttonState2 = 0;

void setup()
{
  pinMode(green, OUTPUT);
  pinMode(red, OUTPUT);
  pinMode(blue, OUTPUT);
  pinMode(white, OUTPUT);
  
  pinMode(buttonA, INPUT);
  pinMode(buttonB, INPUT);
}

void loop()
{
  int val = analogRead(0);
  int lav = analogRead(0);
  
  buttonState1 = digitalRead(buttonA);
  if(buttonState1 == HIGH) {
    
    lav = lav + 50;
    
    analogWrite(10,lav);
    analogWrite(9,lav);
    analogWrite(6,lav);
    analogWrite(5,lav);
  }
   
  buttonState2 = digitalRead(buttonB);
  if(buttonState2 == HIGH) {
    
    val = val - 50:
    analogWrite(10,lav);
    analogWrite(9,lav);
    analogWrite(6,lav);
    analogWrite(5,lav);
  }
  
  analogWrite(green, HIGH);
  sensorValue = analogRead(0);
  delay(sensorValue + 500);
  analogWrite(green, LOW);
  delay(1000);
  
   analogWrite(red, HIGH);
  sensorValue = analogRead(0);
  delay(sensorValue + 500);
  analogWrite(red, LOW);
  delay(1000);
  
   analogWrite(blue, HIGH);
  sensorValue = analogRead(0);
  delay(sensorValue + 500);
  analogWrite(blue, LOW);
  delay(1000);
  
   analogWrite(white, HIGH);
  sensorValue = analogRead(0);
  delay(sensorValue + 500);
  analogWrite(white, LOW);
  delay(1000);

  
}

I would like to use another potentiometer instead of button but actually I'm stuck if someone can just reorganize my code to use another potentiometer instead of button I'd be appreciated one of the potentiometer shoul control speed other should control brightness .

Sorry for schematic of my post this is my first post but for future I'll try to be better.

Thank you for reccomendation I'll try IronCAD.

Your LEDs are ground connected. (Thats OK)

However as rookiestar says

HIGH has the value 1

so analogWrite(white, HIGH); is the SAME as analogWrite(white, 1);

If you want the LED's to be full on you need analogWrite(white, 255);

see the examples here