Voltage divider help!

We are trying to make a voltage divider for our college’s robot. The objective is create voltage(already made) and use an arduino uno to measure when the battery drops from good,warning, dead. I have attached our code to this post. Any help would or pointers in the correct direction would help!

BatteryTester.ino (698 Bytes)

Do not double post.

jremington:
Do not double post.

It's OK, I deleted all the others.

if ( voltage <= 0.04) //8v ??

What are the resistor values of your divider.

I expected to see someting like
if (voltage < 7.25) //8v
Leo…