Wireless Communication

What is the best way of interfacing wireless communication between two arduinos? This would be used for a robot. Custom controller and of course the robot. Both would be running multiple ATmega328 chips.

What my idea was to send data to control the robot by sending different resistance (0-1023) to the analog pins.

For example

int var = analogRead(RxPin); switch(var) { case 1: //Some command break; case 2: //Some command break; case 3: //Some command break; }


Edit: Yes I know I can do Serial. What would be a could communicator if I were to use serial? Remember it's a controller so it needs good response time.

I think you need to explain a little more.

What do you mean by :

"sending different resistance (0-1023) to the analog pins."

And also the Rx pin is a digital pin you can not use analogRead() on a digital pin.

Ah I guess I do.

Okay I need the best way to communicate with an arduino from another arduino with no wires. I have read about the Xbee but read that the response times can be iffy.

I am planning a robot build were I can control the steering amungst other things (lights, arms, etc.). Via the controller which is basically an interfaced arduino.

The "RxPin" example I used earlier was an a bad example. I should have put some code like:

int RxPin = 0; int TxPin = 1;

Now doing this would allow me to free up serial signal. Because I might need to incorporate multiple Atmega328 chips in the robot. (not including the remote control chip. ie. they would all be on the robot.)

I was looking here: [Link] for some communication controls.

The xbees can communicate at speeds up to 115200. That should be plenty fast for controlling a robot.

The xbees, and any other wireless communication system, get the data from the TX pin and broadcast it. Whatever data they receive is written to the TX pin. Using wireless communication is not going to free those pins for you to use in some other way.