Serial not writing after disconnected from the computer

I have been working on the code for my remote control lawn mower and have encountered a problem recently. I have an Arduino Mega write serial commands to an Uno which reads them and outputs the correct LEDs, there is one for each of the four wheels. The problem I am having is after I disconnect the Arduino from the computer and go plug it in the wall the Mega is no longer writing Serial data. Could this be a problem with the hardware? I have attached one of my else if statements below.

Here is the statement

Screen Shot 2015-06-02 at 4.25.00 PM.png

Don't post code as a picture because it can't lbe studied in a text editor.

Also, post the entire code, not just a snippet.

And make a pencil drawing of how things are connected and post a photo of the drawing?

Have you a GND connection between the two boards ?



Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7,148850.0.html

Thanks.. Tom..... :slight_smile: