Counting from 0 to 99 with potentiometer

I'm are making a simple counter with a potentiomer and 2 single lcd digits that counts from 00 to 99.

I understand that I will use analogRead() and it returns a number between 0 and 1023. How do I ensure that at full counterclockwise the value is 00, full clockwise is 99, and the digits in between increment equally.

My assumption is to divide 1023 by 100, then if the analogRead increases by 10 increment 1, and if analogRead decreases by 10 decrement 1.

My assumption is to divide 1023 by 100, then if the analogRead increases by 10 increment 1, and if analogRead decreases by 10 decrement 1.

I don't understand why you are asking. Write some code and try it.

void loop() 
{
  int num = constrain(analogRead(A0) / 10, 0, 99); 
  Serial.println(num);
  delay(300); 
}

The map() function could come in handy to convert the 0 to 1023 range returned by analigRead() into the range 0 to 99

Thanks,

I was not aware of constrain() and map(), I have enough info to start writing code now.

This is not about counting or incrementing, but a mathematical technique called linear interpolation. You are effectively remapping the range 0-1023 onto the range 0-99. The Arduino has a map function that is made exactly for this purpose.

map(analogRead(whatever), 0, 1024, 0, 100);

outsider:

void loop() 

{
  int num = constrain(analogRead(A0) / 10, 0, 99);
  Serial.println(num);
  delay(300);
}

For the love of god no, this is not what the constrain() function is for.