Using RX TX as Output?

Hey,

I want to run approximately 90 unipolar stepper motors with the arduino mega. I need to know how many Mega Boards I´ve to order.
The unipolar stepper are controlled by only 2 wires. (using the ULN2003 as driver). I´m going to communicate the boards together with I2C.
So I need as much as possible ports on the board.

I think I can use the
Analog In 0-15 --> 16 Ports
Digital 22-52 --> 32 Ports
PWM 2-13 --> 12 Ports
in total 60 Ports (minus 2 for I2C) 58 Ports

The questions are:
Is there a possibility to use also the communication ports (rx tx) to get more ports to controll more stepper?
How would the code look like to use them?

I've been using these ports just as normal digital ports, but had to stop that when starting to use serial communication with the board, since then they are in use by that application. So I guess the answer is yes if your not going to use serial communication.

Rexy:
Is there a possibility to use also the communication ports (rx tx) to get more ports to controll more stepper?

Yes

Rexy:
How would the code look like to use them?

Just like any other pin.

Just remember that Serial (pins 0 and 1) is used for communicating with the PC. So you won't be able to do debugging over USB if you use Serial's pins for GPIO.

You better to install 74HC595 chips in pairs with ULN2003 ( ULN2803 is 8 outputs), or TPIC6B595
Shift Register 8-Bit High-Power - TPIC6B595 - COM-00734 - SparkFun Electronics. There are also shields, solid-state relay or FET boards. This would greatly simplify wiring, reducing 90 lines to just 3, and requirements to arduino board, so even smallest of them could works.

Yes, I tried to leave the command "serial.begin(9600) out;" and then the stepper are moving.
Thank you for that,
So now the next question:
I´m going communicate the 3 Arduino Mega with I2C, but I never did this before. Do I need this command "serial.begin(9600);" for the communication?
The Master Arduino will only send and not receive information.

Rexy:
I´m going communicate the 3 Arduino Mega with I2C, but I never did this before. Do I need this command "serial.begin(9600);"

No. I2C is handled by the Wire library.

Start with:

And then Study:
http://www.arduino.cc/en/Reference/Wire