Pages: [1]   Go Down
Author Topic: delay(1) in analogRead()  (Read 636 times)
0 Members and 1 Guest are viewing this topic.
Brooklyn, NY, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 115
arduino for all
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: