Added mod to avoid reset of Arduino when USB serial connection is made
THE NORMAL BEHAVIOR OF ARDUINO IS TO RESET WHEN A USB CONNECTION OPENS The serial communications supported over USB includes the DTS/DTR signals. When a serial connection is instituted by an RS232 device (such as USB on a laptop), signals are toggled that the Arduino detects and issues a reset to itself. This restarts the 'sketch' running in the Arduino so it is in a known good state, but also watches for a specific data stream at the beginning which is targeted at the bootloader. This is how the development environment uploads new code to the Arduino. THIS LEAVES CONTROL SIGNALS IN UNDEFINED STATE FOR A SHORT PERIOD While the processor is reset and running under the bootloader code, the state of various input-output pins on the Arduino is not controlled by your sketch. They assume some default values until you code begins running to set the pins up correctly. For example, an output pin is by default in logic low state. The 1130 makes wide use of inverted logic, where ...