analogRead() and delay() question

I want to make a "universal" infrared RC toy helicopter transmitter. I have a few helicopter models but they all have different protocols with different remote controls. So I want to make one transmitter for all the models I have.

The remote has to have two joysticks with two axis eachs. That means I will use 4 analog inputs on the arduino. The protocol requires that I transmit the state of all the axis roughly 10 times a second. So that means I have to call analogRead() at least 40 times a second. And that's my problem. If I have to call a delay(100) between each call to analogRead() I will not be able to send out the signal fast enough.

Is there any way I can get around this limitation?

I've been a programmer (C/C++) for almost 20 years, but I'm a beginner when it comes to electronics and microcontrollers.

Thank you!

If I have to call a delay(100) between each call to analogRead()

You don't. What makes you think you do?
You can do an analogue read about 16000 per second.

Grumpy_Mike:
You don't. What makes you think you do?
You can do an analogue read about 16000 per second.

Well, that's what I read on several places. For instance:

http://www.arduino.cc/en/Tutorial/JoyStick

It says:

// reads the value of the variable resistor
value1 = analogRead(joyPin1);
// this small pause is needed between reading
// analog pins, otherwise we get the same value twice
delay(100);
// reads the value of the variable resistor
value2 = analogRead(joyPin2);

Also:

http://www.forums.adafruit.com/viewtopic.php?f=25&t=11597

Btw, I don't have an Arduino board yet. I will but one tomorrow, so I can't test anything until then. This is only a fact finding post :slight_smile:

Thanks for the reply!

That quote is so totally wrong. Sadly there is a lot of bad information on the web, and sadly some of it is on this site. That delay serves no purpose at all.
There is a case for putting a delay between two readings of the same input channel on inputs where the impedance is greater than 1K, but that quote is just rubbish.