Help with rgb led code (Potentiometer)

Hi, i was making an led controller with a potentiometer and i spent a long time fuguring out the code, and i got bunch of errors when i came to test it (I'm using tinkercad because my aurduino hasn't arrived yet. Im pretty new tot his so go easy on me. Also wanted to double check the base code and if there's anything i can improve on it.


My code:

// the setup routine runs once when you press reset:
int r = 9;
int g = 10;
int b = 11;

void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(r, OUTPUT);
pinMode(g, OUTPUT);
pinMode(b, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(10); // delay in between reads for stability
if ((sensorValue) < 170 && ((sensorValue) >0); {
digitalWrite(r, HIGH) digitalWrite(g, LOW) digitalWrite(b, LOW);
delay(10); // delay in between reads for stability
}
if ((sensorValue) < 340 && ((sensorValue) >171) {
digitalWrite(r, HIGH) digitalWrite(g, HIGH) digitalWrite(b, LOW);
delay(10); // delay in between reads for stability
}
if ((sensorValue) < 510 && ((sensorValue) >341); {
digitalWrite(r, LOW) digitalWrite(g, HIGH) digitalWrite(b, LOW);
delay(10); // delay in between reads for stability
}
if ((sensorValue) < 680 && ((sensorValue) >511); {
digitalWrite(r, LOW) digitalWrite(g, HIGH) digitalWrite(b, HIGH);
delay(10); // delay in between reads for stability
}
if ((sensorValue) < 850 && ((sensorValue) >681); {
digitalWrite(r, LOW) digitalWrite(g, LOW) digitalWrite(b, HIGH);
delay(10); // delay in between reads for stability
}
if ((sensorValue) < 1023 && ((sensorValue) >851); {
digitalWrite(r, LOW) digitalWrite(g, LOW) digitalWrite(b, LOW);
delay(10); // delay in between reads for stability
}
}


Errors:
In function 'void loop()':
23:50: error: expected primary-expression before '{' token
23:50: error: expected ')' before '{' token
32:26: error: expected ';' before 'digitalWrite'
35:52: error: expected primary-expression before '{' token
35:52: error: expected ')' before '{' token
40:26: error: expected ';' before 'digitalWrite'
43:53: error: expected primary-expression before '{' token
43:53: error: expected ')' before '{' token
47:1: error: expected primary-expression before '}' token
exit status 1

if ((sensorValue) < 170 && ((sensorValue) >0);

;


digitalWrite(r, HIGH) digitalWrite(g, HIGH) digitalWrite(b, LOW);
NO


Notice your if statement?

Notice a proper if statement

if (condition) {
// block of code to be executed if the condition is true
}

Notice the difference between your if statements and a proper if statement?

Notice your digitalWrite statement?

digitalWrite(13, HIGH); // sets the digital pin 13 on

Notice a proper digitalWrite statement?

Can you spot the difference?

The common cathode (?) of your LED is not connected.