Probably simple/studid resistor question

I'm trying to set up some analog inputs. I've got some variable resistors wired like this:

When they are turned to max or zero the circuit works fine but if I turn the Arduino on with the resistor in a mid position it freezes, I get the first reading but nothing else. It's connected through a waveshield but I can't see how that makes any difference. Any ideas what might be wrong. I don't have much code running yet, just this:

void loop()
{
sensorValue = analogRead(A0);
shifter.display(sensorValue);

delay(100);
}

Wiring looks o'k for me. May be software, have you declared sensorValue as a global int? Are the limits- safety check of the input value in shifter.display function?

When you use A0 for a pin, that tells it to treat the pin as a digital input, though it refers to an analog pin. Just use analogRead(0).

xolroc:
When you use A0 for a pin, that tells it to treat the pin as a digital input, though it refers to an analog pin. Just use analogRead(0).

This is not correct. analogRead() knows that A0 means Analog 0.

It is actually a better practice to use "A0" so it is very clear in your code that you intended to use Analog Input 0. Just using "0" could imply you meant digital 0 or analog 0.

nickjb:

void loop()

{
  sensorValue = analogRead(A0); 
  shifter.display(sensorValue);
 
  delay(100);
}

Clearly you have more code because somewhere sensorValue and shifter must be defined.

When posting code snippets the snippet should do two things: 1) compile as-is and 2) replicate the issue. This code fails #1.