This is NOT a problem with a sketch. The sketch has been working fine. But I need to explain the sketch so someone can tell me if my problem is hardware.
I have a password/keypad setup that activates one relay when the correct password is entered. When the # key is pressed, the 2nd relay is activated. The 1st relay triggers the unlock button on a key fob, which unlocks my Jeep doors. The other relay triggers the lock button on the fob locking the Jeep doors.
As I said, this sketch works PERFECTLY. However, I was about to update the sketch so I unplugged the UNO from the 5v power in the Jeep and brought it to my computer. When I plugged it in, I could not upload anything. I noticed, for some reason that in TOOLS, the Port had to be reset. For my UNO it is now set to: /dev/cu.usbmodem111 (Arduino/Genuino Uno). The Board is set properly to Arduino/Genuino Uno.
But here's the big problem where I need to know if there is a hardware or some other problem. When the Arduino UNO is plugged into my computer or back on the Jeep, one of the relays is automatically triggered continuously and is repeatedly locking the Jeep doors (which also honks the horn - a Jeep feature).
Here's some additional information and a test that may help. To stop the action of the relay, I simply uploaded a blank sketch.
I then decided to test a different sketch. This is a simple, stand-alone program that utilizes a keypad and piezo speaker/buzzer. The sketch will activate the piezo one time on each key press. However, with the piezo and keypad plugged into the UNO and when powered up, the piezo is automatically activated continuously - like that relay did.
And to clarify one last thing, both the relay or piezo activating on there own, happens even if the keypad is not connected to the UNO. The power to the Arduino only comes on when the Jeep is turned off. I have a special circuit that only works when the key is out of the ignition.
And as a reminder, the keypad, relays and key fob have been working for months - flawlessly. It's only when I disconnected the power from the Jeep to move the Arduino UNO to my computer that this problem started.
The settings in Tools:
Port:/dev/cu.usbmodem111 (Arduino/Genuino Uno)
BN: Arduino/Genuino Uno
Programmer: AVRISP mkll