C++:
int potentPin =A6;
int potentPin1 =A5;
int val;
int val1;
void setup() {
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(potentPin, INPUT);
pinMode(potentPin1, INPUT);
}
void loop() {
val = analogRead(potentPin);
val = map(val, 0, 1023, 0, 10);
constrain(val, 0, 10);
val1 = analogRead(potentPin1);
val1 = map(val1, 0, 1023, 0, 10);
constrain(val1, 0, 10);
if (val > val1) digitalWrite(8,LOW);
if (val == val1) digitalWrite(8, HIGH);
if (val == val1) digitalWrite(9, HIGH);
if (val < val1) digitalWrite(9, LOW);
}