Need assistance with a voltage read/led blink circuit.

Ok i am trying to create a circuit which will turn on a huge string of 12 volt leds using an arduino. I have the code i wrote and a voltage divider circuit and a mosfet circuit. The circuit works. It does not however work correctly. I turned my arduino temporarily into a voltage meter and read 1023 on pin 1 analog. This is right where id like to be roughly as my battery is at 12.4 instead of 12.6 which should bring it up to 1024. However my circuit blinks the LEDS at any voltage detected until i tell it to detect anything 100 or less on pin 1. I will include my code and see if anyone can assist me. I am brand new and this is a learning experience and i did do research before i asked but nothing was found that seemed relevant.

const int led=9;

const int batV=analogRead(A1);

void setup () {

pinMode(led, OUTPUT);

}

void loop () {

int volt2 = analogRead(batV);

if (volt2 <= 800)

{

digitalWrite(led, HIGH);

delay(1000);

digitalWrite(led, LOW);

delay(1000);

}

else

{

digitalWrite(led, HIGH);

}

}

Define batV as

const int batV = A1;

I changed it to that it is still blinking the LEDS unless i set the <= at 100…i checked again the voltage on pin a1 is still at 1023 so it makes zero sense…i don’t think its the circuit it has to be the code…let me try a second arduino board for spits and giggles…maybe this one is just nuts.

My apologies just realized 1023 is max not 1024 so it is always reading max voltage but again that should tell the code to not blink as it thinks the battery is fully charged…i am still at a loss.

I am so sorry about that. I am a complete noob. I had the Ground connected to A1 and the positive hooked to Ground. I switched them and everything is good! Thanks!