Using "Analog" pins as digital inputs - cant seem to get it working

A bit of a newbie question I suspect ...

I am running a board based on an ATMega328. Arduino is the latest release.
All of the normal digital I/O pins work fine, but I am having trouble getting the Analogue pins to act correctly.

In "setup" I have (in addition to setting up the serial) ...
pinMode(A0, INPUT);
digitalWrite(A0, HIGH); // set pullup on analog pin 0
pinMode(A1, INPUT);
digitalWrite(A1, HIGH); // set pullup on analog pin 1

and in "loop" I have ...
if (!digitalRead(A0))
{
Serial.println("got A0");
}
if (!digitalRead(A1))
{
Serial.println("got A1");
}

The problem seems to be that the pullup resistor is not being enabled ... ie with the switch OPEN the pin only rises to 0.5V
The normal I/O pins float at Vcc when setup as INPUT_PULLUP.
I have tried "pinMode(A1, INPUT_PULLUP)" - it made no difference

What am I doing wrong?
TIA
Dave

just post your whole code - that is easier for anyone to review
and if it is long create a small sketch that shows the problem.

try this

    if (digitalRead(A0) == LOW)  // more explicit
    {
        Serial.println("got A0 LOW");
    }
    else
    {
        Serial.println("got A0 HIGH");
    }

Ooops - my fault - I cannot count pins :wink:
All working a treat now
Dave