I have found a project which looks quite simple:http://nostarch.s3.amazonaws.com/arduino_project6.pdf
I have setup everything according to the text and schematics on an Arduino Uno R3. When I uploaded the code on the board the LEDs just flicker randomly one at a time (while the USB is connected). It is supposed that a LED flashes at a certain voltage when a battery is connected (in this case I want to try on an AA-type 1.5V).
Can somebody explain why it doesn't measure anything from the battery? Maybe I should connect the +-side of the battery to the v_in pin (but how should the code then be)?