Arduino Forum

Forum 2005-2010 (read only) => Software => Bugs & Suggestions => Topic started by: eighthave on Feb 27, 2007, 05:54 am

Title: delay(1) in analogRead()
Post by: eighthave on Feb 27, 2007, 05:54 am

I just saw that there is a delay(1) in the analogRead() function in wiring.c.  That seems like a very long delay.  Is there anyway to make it shorter?  I was hoping to be able to output all of the analogIns per 4ms cycle in Firmata.
Title: Re: delay(1) in analogRead()
Post by: mellis on Feb 27, 2007, 08:05 pm
I think I'll be removing it completely in Arduino 0008.  Previously (and before we had delayMicroseconds()), it seemed that some delay was necessary to prevent analogRead() from returning readings for the wrong pin.  Now it seems to work fine without the delay.  I'm not quite sure why, so I'd like to test it a bit more.