Let's Make Robots!

measuring

Arduino Measuring Time in Milliseconds

Greetings fellow robot builders,

I have used my Arduino so far with much succes but I cannot, for the life of me, find out how to measure the time from one point of the program to another in milliseconds. I have downloaded the Arduino "Time" library and it seems that that can only measure in whole seconds and as many of you know, a second is a very very long time in a program. By the way, I do not want the robot to pause in this time. (I know about the "delay" function)

Any help would be appreciated.

Thanks, Riddellikins

Measuring voltage with an Arduino

I was wondering if I could measure battery voltage simply by hooking the battery's + to an analog Arduino pin so that my robot can know when it's low on power. From what i've understood, a battery of 1.5 volts is dead when it outputs 1.4 volts (gonna do some research about this). I guess I can apply this approximation to different voltages battery. The only problem is that, if I want to use a battery with voltage superior to 5v (Arduino analog pins set 5v as a maximum), how do I divide the voltage? Again, I guess I'll need op-amps to do that and voltage dividers, but what do I exactly do?