As you have not posted the program you tried on your Mega I have no idea what you were trying to do.
A clear diagram showing how you had everything connected would also be a great help. A photo of a simple pencil drawing is probably the best thing. Please do NOT use Fritzing.
...R