Connecting Code-Files on Arduino

Hi guys, is it possible to connect many(2-3) program-files together on Mega2560? I have one code for camera and one for the 4x4-keyboard & LCD. Now I want to bring the code-files together.

Thanks! :)

Break the individual sketches into non-blocking functions, merge the "setup()"s into one and test. Rinse and repeat.

(This is the "Programming" section - we prefer to see code. Please use code tags.)

I tried it, but without success :/

here the Link for the code's: 1. Camera-Modul OV2640 with ArduCam-F(and microSD-Card)

  1. 4x4-Keypad with LCD

I must implement Camera-Code into 4x4-Keypad-Code. Thanks friends :)

I tried it, but without success

Where is YOUR code? What happened when you tried to compile/link/run it?

The code is in Dropbox and I sent in the last message two links for the codes, if you see. Here again: Open the link's and download the codes.

When I compiled the combined code, arduino ran the 4x4-Keyboard-code, but he skipped the Camera-code.

Open the link's and download the codes.

No. Attach the code properly, using the Additional Options link.

When I compiled the combined code

You have two ingredients. You combined them in some mysterious fashion that you won't tell us about. Now, it doesn't do what you want. Of course, you haven't told us what that is. Now, you want help? I don't think so. (Yet.)

PaulS, the code is too long(more than 9500 character). That's the reason, why I sent the Link. There is the Link for the code, where are the both code's connected. ;)

the code is too long(more than 9500 character)

So, use the file attach facility.

there the attachments :wink:

Tastatur_mit_LCD_v1_4.ino (27.3 KB)

ArduCAM_OV2640_JPEG_FIFO_SD.ino (2.81 KB)

sketch_oct15a.ino (29.2 KB)

It looks like you’ve got a lot of RAM usage - it would be a good idea to move your constant strings in your LCD functions into program memory, using the F() macro.