The MSP430G2302 microcontroler code source wich commands the motors interface

This source is the app running on the microcontroler. it's divided in three functions:
1-)the serial function wich is used in an interruption mode, reads messages from the server running on the MR3020 via a serial link through a USB/RS232 converter. When no request is available from server or when it has finished an action the microcontroler returns in a sleeping mode to reduce consumption.

2-)The motor driver: each relay is activated by a pin(P2.0 to P2.5, P1.6 and P1.7) of the microcontroler via an ULN2003 wich provides the curent needed by their coil. This pins are used in output mode.

3-)The arm limit position dectection through limit switches.
This pins(P1.0, P1.3 TO P1.5) are in input mode and trigger an interruption whwn a High to Low level variation occures.
Note that limit switches are just pushbuttons placed on the arm, wich are activated when extreme position are reached. These positions are ARM MOST UP, ARM MOST DOWN: to protect the cable wich bring up the arm, ARM MOST LEFT and  ARM MOST RIGHT:to protect electric cables wich turn with arm. Note that when one of these positions are reached, the program stop automatically the concerned motor and runs it back untill the limit switch associeted is still active. This allows to free the limit switch and increases it life.
Note too that the program is not perfect at this time and is in working.